3 ms·
Ignoring rust or any language specific thoughts... Sure, but there are many cases where it's still better to have slightly slower code at the expense of readabi
by cookieperson 3y ago
Ignoring rust or any language specific thoughts... Sure, but there are many cases where it's still better to have slightly slower code at the expense of readability/extendability/maintenance. Even in HPC applications. I know I know some very smart people are about to throw their sharpened axe at me. But in my experience very rarely does someone truly need to sacrifice a bounds check to deliver their product or save meaningful amounts of $ in prod. Not saying all loops must be bound checked, that's a dumb hill to die on. But I've seen devs hyperfocus on hypothetical minimal gains that get blown away two days after the code lands, or a minor requirement changes.
The challenge with DO NOT TOUCH this code comments that intense performance tuning leads too(figuratively and literally) is it makes people who don't understand the code build bizarre(and often slow) monuments all around it that don't usually need to exist and deter from the minor gains won over a cute optimization. I've seen this happen ALOT.
Of course there are times where you should opinionate your code to better serve the machine. But my big thing is, it's rarer then the overly complex design decisions favoring it are and compilers are getting better every day.