Comment by freehorse

3 days 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.

This 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.

  • You get to the same point with non-considered idiomatic syntax also, the only problem being that it will be only you who understands it.

    • Only 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).