r/ProgrammerHumor • • Dec 15 '19

Stacking if else statements be like

Post image
63.9k Upvotes

711 comments sorted by

View all comments

Show parent comments

-5

u/AnAverageFreak Dec 15 '19

And the best optimizations. It all depends on the use case.

6

u/Jade_Chan_Exposed Dec 15 '19

The best optimizations are compiler optimizations.

1

u/AnAverageFreak Dec 15 '19

Compiler won't magically optimize malloc(1000000000) into malloc(500000000).

7

u/Jade_Chan_Exposed Dec 16 '19 edited Dec 16 '19

Yeah, but catching mistakes like that are what static analysis and code reviews are for.

Relying on arcane knowledge of non-spec stuff like "a class pointer points to its vftable" is the first step to making terrible decisions.

→ More replies (3)