Andrea Koutifaris
1 min readAug 14, 2020

--

Which is the che conversion from fahrenheit to celsius 9/5 or 5/9? Because most of the people will not able to answer immediately, CELSIUS_TO_FAHRENHEIT_RATIO is slightly better (even though in a JS code review I would not ask to change it until it remains module private).

I am not sure in what you disagree with Robert Martin about comments. It seems to me that what you say about comments is included in what Robert writes about comments in his Clean Code book.

I've almost never found a useful piece of comment/documentation in the code, so I prefer no documentation/commenting at all. Of course if you are doing a public library/framework/utility you need to have a very good documentation and some meaningful comments.

I don't remember where I read it, but writing a public library is way more difficult than writing an application code, so, unless requirements say the opposite, do not code as you are writing a library. On the contrary write as much private as possible code and generalize only when some piece of code need to be reused.

Anyway this is my opinion, Martin never says not to write documentation or comments. He says a few on documentation, he says to write meaningful comments making examples of good and bad comments. What the code does is a bad comment, why is a good comment, for example.

--

--

Andrea Koutifaris
Andrea Koutifaris

No responses yet