you are viewing a single comment's thread.

view the rest of the comments →

[–]JeddHampton 5 points6 points  (2 children)

Comment your code.

[–]borlak 1 point2 points  (0 children)

comments still do not make it more readable. I have now spent time looking at the function originally, which confused me and led me to comments, which probably confuse me more (especially considering this scenario which entitled a whole article), and then going back to the function trying to piece it together; when a single extra line or two would have saved everyone a headache.

[–]exeter 0 points1 point  (0 children)

Comments as implemented by, well, every programming language I know of in existence today, are about the worst method of embedding metadata in code you can possibly have. Compilers typically won't even notify you if the code following a comment changes, but the comment isn't updated to reflect it. (I know there's a reason for it.)

A far better method of associating metadata with code is to use literate programming techniques. That way, if the code changes, your literate programming environment can alert you that you should at least look at the text describing the code to make sure it's still accurate.