Skip to main content

Timeline for "Comments are a code smell"

Current License: CC BY-SA 2.5

15 events
when toggle format what by license comment
Sep 7, 2011 at 14:47 comment added David Schwartz The question on which I am commenting. Sorry if that wasn't clear.
Sep 7, 2011 at 14:44 comment added Paul Nathan @David: Who and what are you talking about?
Sep 7, 2011 at 13:56 comment added David Schwartz Your example proves the opposite of what you think it proves. Had this code been commented, you would have been alerted to the fact that it implements a complex algorithm and that it requires more careful auditing than typical code does. So it should have been commented, and the commenting should have caused you to look at the code extra-carefully.
Jan 31, 2011 at 17:35 comment added Paul Nathan @Geoff: I'll look it over to see if it has a public license. It may not be. Most of the code I touch related to other people is not open source.
Jan 31, 2011 at 11:16 comment added Geoffrey @Paul Nathan, maybe you could post the code on codereview.stackexchange.com and then post a link to it in this answer.
Jan 31, 2011 at 9:04 history made wiki Post Made Community Wiki
Dec 15, 2010 at 21:51 comment added Chris This answer reminds me of being in university days discussing Dijkstra's algorithm. In the book, the pseudo-algorithm is a handful of lines but if you actually try to implement it you realize what the pseudo-code represents. Its pretty, elegant, short and concise but far from straight-forward to implement.
Oct 4, 2010 at 7:56 comment added Murph @Thorbjørn it was an Oracle COM object being called from VB5/6 no idea why at all (other than it was, fairly obviously, a nasty and obscure bug) and it was over 10 years ago... but it illustrates the point. Similar issues now would be with things like formatting requests to web services where, for example, you have to populate redundant/optional fields despite logic and the manual (if any) telling you otherwise.
Oct 4, 2010 at 6:45 comment added user1249 @Murph, nasty, can you remember why this was so?
Oct 4, 2010 at 6:44 comment added user1249 @Liggy, code implementing complex datastructures can be completely incomprehensible without extensive documentation.
Oct 1, 2010 at 23:06 comment added bmargulies Math, math, math. Not all code implements trivial IoC glue and 'price * quantity'. Complex math cannot be made magically to self-explain.
Sep 27, 2010 at 7:28 comment added Murph I once had a piece of code where you had to populate fields in a database column object (3rd party) in the "wrong" order (defined by the "logic" of the process and our coding standards) - do it in the order we'd normally use and it would crash. No amount of reading the code could tell you this so it positively, absolutely, had to have a comment - and it wasn't a smell, at least not in code over which we had control (which is the bottom line). A complete and utter lack of comments is as much a smell as poor comments.
Sep 15, 2010 at 17:14 comment added Paul Nathan @Liggy: I would. It's a research algorithm, not a line-of-business application.
Sep 15, 2010 at 1:34 comment added Liggy I'm curious to look at "well-named, very clean, uncommented code" that is hard to follow. Any code that I would classify as such has been very easy to follow. I certainly wouldn't go as far as "Your co-worker is not experienced enough, obviously".
Sep 2, 2010 at 16:29 history answered Paul Nathan CC BY-SA 2.5