Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!ur-tut!msir_ltd From: msir_ltd@ur-tut (Mark Sirota) Newsgroups: comp.software-eng Subject: Re: American Programmer Message-ID: <1664@ur-tut.UUCP> Date: 6 Apr 88 07:03:39 GMT References: <87@studsys.mu.edu> <3850007@wdl1.UUCP> Reply-To: msir_ltd@tut.cc.rochester.edu (Mark Sirota) Organization: Univ. of Rochester, Computing Center Lines: 27 In article <3850007@wdl1.UUCP> rhj@wdl1.UUCP (Bob Jones) writes: > The premise that one will put comments in later is in a class with > comments like "the check is in the mail". Believers in this premise most > likely still believe in the tooth fairy. > > Adding comments as you go is the only way to fly. It may require a small > amount of additional time up front, but the payoff is huge down the road. > Poorly commented code is, in my personal opinion, one of the key > indicators of an immature and impatient programmer. Agreed, but allow me to break this up a little further. I *never* add in-line comments until I'm done writing and testing the algorithm or procedure in question. There is such a thing as over-commenting, and the threshold is much lower when the code is incomplete. Sometimes comments just get in the way and make the code harder to read, so I generally prefer a "how" and "why" (as opposed to "what") comment at the top of a section of code, with nothing inside. "what" comments can be added later, as appropriate, to clarify complicated code for the future. So I think it's a mistake to make a blanket claim that adding comments later reflects an immature programmer; sometimes it simply makes more sense to do it that way. -- Mark Sirota msir_ltd%tut.cc.rochester.edu@cs.rochester.edu (rochester!ur-tut!msir_ltd)