Why do people on Sup Forums often forget these rules?

Why do people on Sup Forums often forget these rules?

need to optimize fizzbuzz for mission critical performance

did you write this yourself lol

one of my professors wrote code during the 60s for the moon landing. even to this day, all of his variables are one or two letters, so are his functions, etc. it's so fucking awful to read it.

Because people on Sup Forums almost surely do NOT work as programmers. (web-macaques are not programmers and you know that)

wtf does rule 1 even mean ? those things aren't even related. you can optimize performance with all kinds of hacks and still make readable

Readability and performance are literally never mutually exclusive as long as you write half decent comments.
This

Yeah, but I'm qualified to. Here's another one

Here's an example since you're obviously too retarded to grasp the obvious: not using xor swap on ints when regular swap is enough.

>Never compromise code readability for optimization
Do you know what a fucking comment is for?

>sum of all primes below two million
Why does anybody think memorizing a sieve is impressive?

/* prematurely-optimized division by 16 because I'm too stupid not to know it's done by the compiler even with -O0 */
unsigned int fag = op & 0xF;

>All code optimizations are done by the compiler
I'm not saying reduce your entire codebase to bitshifts like some tryhard faggot, but if you optimize your code into some confusing blob of shit that you'd have to have written or study for an hour to understand, just write a fucking comment

you do know that xor swaps perform way worse than swaps with a temporary variable or if your cpu supports it, it's own swap instruction ?
you couldn't have given a more retarded example

I didn't say "all code is optimized", that particular statement can be written as
fag = op / 16; and would still be optimized to a bitwise AND.

I've seen some shit that not even the most detailed comments can explain and pretty much must be rewritten.

>xor swaps perform way worse than swaps with a temporary variable
Show me the assembly with -O0 and -O3. No internal instruction allowed.

you can't do it yourself ? i'll help you: it's gcc -S

>memorizing
It's not. You're supposed to know how a sieve works and be able to implement it. The concept of a basic sieve is simple: you mark off multiples of consecutive primes, e.g. all composites. If you can't work up from there, you're worthless. And you don't actually need a sieve, since 2 million is still a small number to brute force via trial division provided you implement trivial optimizations (e.g. don't bother checking even numbers), and so those that fumble while regurgitation a sieve and give up instead of moving on to simple trail division are outed as incompetent code monkeys.

Doing two billion atleast shows you probably know how pointers work. 2 million is pretty much pointless.

Burden of proof is on you, faggot.

3x xor > 1x xchg
i hope you have enough working braincells to get it now.

I said no xchg instruction, cuck.

> pretty much pointless
Kek
You made a joke

>image
literally java programmers

They never knew them in the first place.
The number of people on Sup Forums who have worked to hone their art is pretty small.

no you didn't. and swaps using a temporary variable get optimized to xchg by the compiler.

Oh shit I did.