MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/videos/comments/dcpbt2/every_programming_tutorial/f2acdwh
r/videos • u/Thefriendlyfaceplant • Oct 03 '19
1.4k comments sorted by
View all comments
Show parent comments
9
Good code doesn’t need to be loaded with comments. The code base I’m working in has maybe 3 comments per file and it’s perfectly readable.
4 u/[deleted] Oct 03 '19 This is the real key. Don't leave any doubt in your variable or method names and things will be a lot clearer even without comments. Of course document your methods, but you shouldn't need to explain line by line how it works. 3 u/Konrad_EU Oct 03 '19 And if a function become too big you need comment to understand what it does, you probably need to break it down into subfunctions instead. 2 u/modernkennnern Oct 03 '19 The better your code, the more intuitive it is, and the more intuitive it is, the less comments you need.Generalising of course. Some things can't be intuitive
4
This is the real key. Don't leave any doubt in your variable or method names and things will be a lot clearer even without comments. Of course document your methods, but you shouldn't need to explain line by line how it works.
3 u/Konrad_EU Oct 03 '19 And if a function become too big you need comment to understand what it does, you probably need to break it down into subfunctions instead.
3
And if a function become too big you need comment to understand what it does, you probably need to break it down into subfunctions instead.
2
The better your code, the more intuitive it is, and the more intuitive it is, the less comments you need.
Generalising of course. Some things can't be intuitive
9
u/ImpeachTraitorTrump Oct 03 '19
Good code doesn’t need to be loaded with comments. The code base I’m working in has maybe 3 comments per file and it’s perfectly readable.