Marcos Sandrini
1 min readDec 23, 2021

--

Hi, I appreciate your effort and I agree with the general lines. However, I'm going to nitpick a bit here because I think this is a very important subject so, please, don't take this personally.

Point 1 is implicitly saying that a shorter code is better. This is not necessarily the case. Although in your example it surely is, I would be careful in making this a general rule, as intermediate descriptive variable names can be crucial for a better understanding of the surrounding code.

A friendly advice: regardless of what you said already, I would correct the examples returning values on else, especially the ones on point 4. I know they are just isolated examples, but they are still wrong and they'll help generate noise (comments) that will probably detract from the value of your article.

Finally, on point 5 you talk about destructuring but, in my humble opinion, it can decrease the overall clarity in several contexts because it makes everything less immediately traceable. In a simpler piece of code that can be okay, in a bigger one maybe not so much. Also, not related to the article but I have seen lots of people using destructuring because their linting was enforcing too few characters per line, so they wanted to save space. This is maybe the worst possible reason to use destructuring, so be careful out there.

--

--

Marcos Sandrini
Marcos Sandrini

Written by Marcos Sandrini

Designer and front-end programmer with 20+ years of experience, also a keen observer of the world and its people

Responses (1)