3 ms·
For me, this is more like a guideline to aim for, not a rule to die by. I aim to make my code as simple as reasonable while also striving not to compromise _too
by drakonka 4y ago
For me, this is more like a guideline to aim for, not a rule to die by. I aim to make my code as simple as reasonable while also striving not to compromise _too_ much on performance. If some feature just requires more complexity than a junior programmer would easily understand, I don't beat myself up over it and be sure to leave relevant comments where I feel they're necessary.
Maybe this is very stuck-in-the-past of me, but one simplistic example for me is for loops. Various languages have different handy ways of iterating over a collection with `foreach`, `for in`, `for of`, LINQ methods, etc. Personally, I just think a simple `for (var i = 0; i < blah; i += 1) {}` is the simplest variation to read and understand without wondering about internals like which value you are iterating on and such, which usually translates well across languages in terms of readability. I don't think this is a "best practice" by any means, just a personal preference that I perceive as resulting in generally more readable code.