G+_mike klaene Posted December 23, 2014 Share Posted December 23, 2014 Comments are critical to good programming practice. Granted I am a dinosaur when it comes to programming having started in 1969 with S/360 Assembler. I had taught for a couple of years as an adjunct and one thing I stressed was the need for meaningful comments. If you need to work on a change to code you wrote more than 6 months ago it will be almost like you are working on some other programmer's code. Link to comment Share on other sites More sharing options...
G+_Nate Follmer Posted December 24, 2014 Share Posted December 24, 2014 I over comment ;) I can't tell you how many times I've written something or only gotten half way through some code and forgot why or how I did something. COMMENT, COMMENT, COMMENT! Link to comment Share on other sites More sharing options...
G+_Lee Crocker Posted December 24, 2014 Share Posted December 24, 2014 I saw a snippet on stack overflow last week: def shuffledeck(deck): random.shuffle(deck). #shuffle deck I nominate this for "most useless comment ever" award. Link to comment Share on other sites More sharing options...
G+_Mark Cahill Posted December 28, 2014 Share Posted December 28, 2014 Nathan Follmer?, mike klaene? there's a school of thought that says extensively commenting your code is a bad idea. I suggest reading Robert C Martin's (aka Uncle Bob) Clean Code book if you haven't already. For a beginner I think comments are a good idea (because beginners aren't in a position to read the code and immediately understand what it does), but for a professional maintaining a large code base the Uncle Bob theory is that you should write easily understood code so that most comments are superfluous. There's still a place for comments in particularly tricky code but I think they should be the exception not the rule. Link to comment Share on other sites More sharing options...
G+_mike klaene Posted December 29, 2014 Author Share Posted December 29, 2014 Having spent 45+ years writing and maintaining code, I can assure you that meaningful comments can be a life saver. The 2nd language I learned, after Assembler, was COBOL which was designed to be self-commenting. It is not always easy to follow - particularly with a period being misplaced. Obviously, any tool, can be used wisely or carelessly. This includes both comments and objects. Link to comment Share on other sites More sharing options...
Recommended Posts