Re:Skills Poor Programmers Lack
by transreal on Sunday July 21, 2019 @12:47PM
(#20492197)
I see this in professional work. The former reads more like English, and so there feels like there is an argument to be made that it is more readable, and also an argument that "the compiler will optimize it for you anyway".
[ Parent
| on HN ]
Are they wrong? To me, the long version is valid precisely because it is explicit (more to me than the short version), and will be optimized
and you question yourself if it was better to pack that readability into a function or not.
Also why would anyone store a boolean named isDone rather than just returning it as the contract of the function