|
|
|
|
|
by jasonpeacock
3585 days ago
|
|
NO. That is not more readable, and is warned against in most style guides and code-quality books. In the original, at a glance I know exactly what is going on. In your version, I have to read the whole sentence carefully to notice that it's even a conditional and not a normal assignment, and then I have to mentally unpack it to understand the logic that you're trying to implement. If/else should never be a one-liner. Good code is boring code :) |
|