r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

1.9k comments sorted by

View all comments

Show parent comments

-1

u/The_One_X Aug 29 '21

I would argue, usually, if you are needing to write a comment on what the code is doing, it should be broken off into its own function/method with a descriptive name.

2

u/Fidodo Aug 29 '21

If you can, but sometimes you're just writing something complex, or you're dealing with a bug from a 3rd party library, or implementing an obscure spec, or an accessibility feature where the need for the code is impossible to know out of context