546
TypeScript is Quantum Ready
(programming.dev)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Screw else statements, people who use if-return have 180% more readable code.
Because everyone knows a function stops at the if-else. Nothing ever happens afterward.
You're writing extremely bad code if that's the case and you need to refactor. The point of a function is to return a value. Anything else is just there to waste cycles and make the code less readable. You should also never use else statements for arithmetic due to their massive relative overhead. Your processor can do multiple arithmetic operations in the time it takes to process one if statement, and don't get me started on people who demand you use nested if even though switch statements are way faster and leagues more readable.
Who's suggesting that people are using if statements for arithmetic?
The only time that you can feasibly replace an if statement with arithmetic is if it's a boolean, but frankly that's an edge case... Also if you're not writing in rust or c or whatever then don't worry as the interpreter will run a huge amount of branches for every line of code (which is what all your nested ifs, switches, gotos, returns etc. will compile down to anyway)