|
|
|
|
|
by jschwartzi
3752 days ago
|
|
Every discussion of code style eventually devolves to a discussion about readability, which eventually devolves to a knife fight in a conference room because one man's readable expression is another man's opaque one-liner. |
|
This basically means that these keywords and operations are always OK:
and these things should only be used when it would be unreasonably intrusive or problematic to perform the same operation using only the above flow control mechanisms: The goal is to keep the program as simple and straightforward as possible. Of course you're going to need some of the things in the second category to do that sometimes. But my opinion is that one should start with the basic building blocks, and if one finds that it will save a lot of effort and time in both reading and writing the code to use one of the secondary things, only then should those things be deployed.For example, if you're using a lambda, you should have a good explanation for why a function definition wouldn't have worked. "Lambdas take one line and defs take two" isn't a good reason.