Re:Ask HN: Why Did Python Win?
by arcanemachiner on Tuesday August 29, 2023 @11:17PM
(#37317256)
> from what I see commenting code is frowned upon by a certain subset of developers
I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a... belief.
Re:Ask HN: Why Did Python Win?
by bigger_cheese on Tuesday August 29, 2023 @11:41PM
(#37317397)
The main argument seems to be comments should left with the commit message and not "inline" i.e mixed with the code. Personally I make heavy use of inline style comments.
Re:Ask HN: Why Did Python Win?
by citizenpaul on Wednesday August 30, 2023 @01:43AM
(#37318124)
I've worked in tech my whole life and never heard a dev make these comments are bad claims. I only work in the boring world though. Is this a startup or FAANG or silicon valley thing?
Re:Ask HN: Why Did Python Win?
by dmarchand90 on Wednesday August 30, 2023 @02:34AM
(#37318435)
In clean code there is a chapter about eliminating useless comments. I think this has some merits. Think of the following made up example:
sum = sum_two_numbers(number1, number2)
Probably doesn't need a comment.
The other argument is that comments need to be maintained and are subject to decay. E.g. the code they are commenting on changes.
The book goes into other examples but i think the idea isn't to eliminate comments but to be thoughtful and judicious in which you use
I've learned to add comments to my code - from what I see commenting code is frowned upon by a certain subset of developers but I've taught myself that whenever I am doing something subtle or unintuitive to add a short comment explaining what the code is doing, for every potentially unnecessary comment I've added I've also saved myself time when I've had to come back to something months or years later and been able to refer back to the comment.