Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
1 for sure, maybe 3 in some special cases, but usually always stick with clean and simple code. That's day-one shit.
-
mhudson12937yIf others are going to see and use it, strive for clarity.
If it's for missile guidance or something else that's time-critical, go for optimization.
Tune those considerations for all applications in between. -
@mhudson the issue with time critical stuff is that it's still probably got to be maintained by someone. IIRC the embedded guys I used to work with used to write their code in visual studio and then run some variety of witchcraft on it that would optimize it ahead of installation.
-
mhudson12937y@projektaquarius sounds like the end product was optimized 😂
Seriously though, where witchcraft is lacking, I think in reverse-YAGNI. What is most desperately needed?
If the performance is desperately needed, I'll crack open some inline assembly to meet benchmarks (I think that's been needed all of one times in the last ~seven years)
Clarity is really important. Really really important - but on the rare occasions where every-expletive-cycle matters, I'll sacrifice some clarity to hit benchmarks. -
@mhudson oh most definitely. But I figure if you can write it clearly, then majick it into optimized code, do that.
if a = CLEAN
b= OPTIMIZATION
Whish one is best
1) a>b
2) a<b
3) a>=b
4) a<=b
undefined