From: Dave Thomas Date: 2001-04-22T05:04:13+09:00 Subject: [ruby-talk:14001] Re: From Guido, with love... "Mitch Vincent" writes: > If the comments are useless (and it's a little hard for anyone to know > that until *after* they understand the code..) then you can ignore them or > change them to be useful.. If you got rid of the comments in any of my code > (for some of the larger projects), you'd run into trouble quick when you > made changes.. Possibly this might be cause for concern... > I always try to include "If you change this, you have to change > X,Y,Z over in the XYZ function etc etc" type comments... ...as this would seem to imply a degree of coupling that you might be able to design out, rather than ameliorate with comments. Comments that explain the code seem to me to be a symptom of code that doesn't speak for itself. Well written code, decently factored and honoring the DRY principle, can get by with few comments. To my mind, comments are certainly useful for explaining stuff that _isn't_ in the code. Why we chose algorithm A over B, for example, is a good comment. An overview of where a module is intended to be used seems to be a good comment. But comments are an individual thing: I don't think there's a right or wrong answer. Dave