4 ms·
25 years for me > Clever code isn't usually good code. Clarity trumps all other concerns. Agreed, with exceptions... the problem domain matters. HFT code def
by DrBazza 6y ago
25 years for me
> Clever code isn't usually good code. Clarity trumps all other concerns.
Agreed, with exceptions... the problem domain matters. HFT code definitely demands code that is clever, but isn't clear such as bit twiddling, template tricks, and very architecture specific solutions. Gaming - Carmack's fast inverse square root. Compilers - Duff's device. I'm sure there are others.
I'd add one: Someone else did it first and better. Pretty much everything you'll encounter that's non-trivial, is likely an algorithm and done by someone else better, correctly, and faster. There's nothing wrong with knowing the algorithms, but Knuth, Hoare, et al. probably did it first, and correctly. Don't be afraid to find the best algorithm implementation in your language.