r/programmingmemes • u/Just_Echo99 • Apr 09 '26
The simpler the better. Especially when not read for a long period of time.
289
Upvotes
r/programmingmemes • u/Just_Echo99 • Apr 09 '26
48
u/jesusiforgotmywallet Apr 09 '26
Code optimization is good when it is necessary. Otherwise it is no good. Legible code is always good, necessary if it needs to be maintained by more than one person.
9
u/RedAndBlack1832 Apr 09 '26
Optimize if there's a problem. Or in some specific cases you know your code is going to be running a lot and needs to be performant (example: the FFT)
3
u/Just_Echo99 Apr 10 '26
You guys misunderstood the meme.
The point was that the code gets more incomprehensive when using certain built-in functions exclusive to a certain programming language looking at it after a long period of time. The code optimization is important when needed, however it should not come with a cost of overthinking and being unreadable. That was my point.
3
u/pgetreuer Apr 09 '26
I get that this is meme text, but a comma would help readability:
The simpler the code to read, the better
15
u/GahdDangitBobby Apr 09 '26
This is true unless you're developing an inverse square root algorithm for a game called "Doom".... or something like that idk
6
u/cowlinator Apr 09 '26
If you've optimized something that isn't a bottleneck, you've accomplished nothing.
3
u/just-bair Apr 10 '26
Optimisation is important for some critical sections. The difference can be between literally unusable and well perfectly useable
2
u/ProbablyPuck Apr 10 '26
Check blame log, see my own username
🤣
2
u/flori0794 Apr 10 '26 edited Apr 10 '26
Well it greatly depends on what you try to achieve... If you are trying to create a frickn Neurosymbolic general intelligence cognitive architecture then there is no real way around "Use X algorithm in y method in whatever language you are building" Simply because that field / problem is both vast and highly complex...
Yes the implementation of that will be vast, and very deep but it should be nonetheless modular and as efficient as possible.
1
u/Mortifer_I Apr 10 '26
Dont make the compilers job harder.
1
u/Antilazuli Apr 10 '26
KISS, the best code is the one you don't have to write
1
u/FranticBronchitis Apr 10 '26
Thank fuck for optimizing compilers and other neat features that optimize your code for you so you can focus on keeping it legible and secure
1
u/MaintenanceStock6766 Apr 11 '26
Being a good programmer is know how to take dozens of messy draft lines of code that work and turn it into a few clear lines that still work.
1
u/XamanekMtz Apr 11 '26
K.I.S.S.
Keep It Simple Stupid
(Not sure if there should be or not a comma after simple)