Spyke

Posts

The Yandere Dev/Pirate Software dilemma

UPDATE: The consensus seems to be overwhelmingly in favour of the match variant. And not to worry, I have replaced the magic numbers with an enum. Will try to remember to merge the branch tomorrow

Does an if-statement block or a switch statement fit better here? For context (and advertisement), this is part of my all-purpose utility plugin ( Codeberg link)

The code:

		# Method 1 (Yandere Dev Technique)  
		if self.throw_errors and status==MpupTest.TESTSTATUS.ERROR:  
			push_error(result)  
		if self.throw_warnings and status==MpupTest.TESTSTATUS.WARNING:  
			push_warning(result)  
		
		# Method 2 (Pirate Software Technique)  
		match status:  
			MpupTest.TESTSTATUS.ERROR:  
				if self.throw_errors:  
					push_error(result)  
			MpupTest.TESTSTATUS.WARNING:  
				if self.throw_warnings:  
					push_warning(result)  
View original on piefed.social

We should write all numbers bigger than 999 999 in powers-of-10 notation

Most people can't handle dealing with million/billion/... numbers, which leads to mistakes like "Elon Musk has 600 billion dollars, he could give every person on Earth a million dollars and still be a billionaire".

Doing that with scientific notation would be clearer:
600 billion dollars=6e11
divided by 1 million dollars per person (1e6)


(6/1)e(11-6)=6e5=600 000 people Elon can give money to before running out (and that's if we assume he has that much in cash and not assets and stuff)

View original on piefed.social