4 ms·
Simplicity of Code
- mattbgates 10y agoYou take code and you make it into poetry. I can't tell you how many times I write out code, get it all done. It works perfectly. But being the perfectionist that I am sometimes, I look back on it and think, "This can be written so much better." Sometimes, I can take 10 lines of code and transform it into 3 or 4 lines of code. And yeah, maybe a human being won't notice the difference in the time it takes to execute 10 lines of code vs 3 or 4 lines of code, but the developer knows those few nanoseconds can be reduced. Code is poetry!
- dwe3000 10y agoThe two code examples don't do exactly the same thing. Consider lvl=1000. That being said, I do appreciate the author's sentiment of insuring the code is easily readable by humans.
- garagol 10y agoThanks, I fixed it. Realistically lvl would never go above 3 digits, but in theory all cases should be covered, absolutely.