
Simplicity of Code - garagol
https://titan.red/simplicity-of-code.html
======
mattbgates
You 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
The 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
Thanks, I fixed it. Realistically lvl would never go above 3 digits, but in
theory all cases should be covered, absolutely.

