3 ms·
Imo, if you read such code the first time, you may prefer the first. If you read it for the 20th time, you may prefer the second. Once you understand what you a
by freehorse 11mo ago
Imo, if you read such code the first time, you may prefer the first. If you read it for the 20th time, you may prefer the second. Once you understand what you are doing, often one prefers more concise syntax that helps in handling complexity within a larger project. But it can seem a bit "too clever" in the beginning.
- rkomorn 11mo agoThis happened to me with comprehensions in python, and with JS' love for anonymous/arrow functions. Once you get used to a language's "quirks" (so long as they're considered idiomatic), they no longer feel quirky, and it's usually pretty quick.
- freehorse 11mo agoYou get to the same point with non-considered idiomatic syntax also, the only problem being that it will be only you who understands it.
- rkomorn 11mo agoOnly so long as you keep the habit going. I've definitely written some things that I came back to much later and had to relearn (which is somewhere between embarrassing and humbling).