----- Original Message ----- From: "Kay Pentecost" <[EMAIL PROTECTED]> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Sent: Friday, December 17, 2004 1:44 PM Subject: RE: [XP] Re: Pretty code vs Good code
> > Hi, John, > >> -----Original Message----- >> From: jhrothjr [mailto:[EMAIL PROTECTED] >> Sent: Thursday, December 16, 2004 3:21 PM >> To: [EMAIL PROTECTED] >> Subject: [XP] Re: Pretty code vs Good code >> >> >> >> --- In [EMAIL PROTECTED], "Kay Pentecost" >> <[EMAIL PROTECTED]> wrote: >> > Hi, Everybody, >> > >> > Since I've learned to recognize "bad" code -- most of the time, >> anyway, I've >> > been really interested in figuring out what "good" code is, >> and how to >> > describe it... >> > >> > Today I stumbled across this article: >> > >> http://www.sdmagazine.com/documents/s=9472/sdm0501f/sdm0501f.h >> tml?temp=xl2u0 >> > uFbvj >> > > <snip> >> >> As far as the article went, it wanted a secure connection, >> so I ignored it. > > I hate it when they do that. Do they want people to read the article, or > what? > > >> >> I spent quite a few years as an independent contractor, >> and I agree with the "match the style" dictum when I'm >> in that situation. At least, I do if I can _find_ a style, >> rather than a hodgepodge of different styles contributed >> by a generation of developers and contractors, each >> with the opinion that _they_ knew how to write maintainable >> code. > > I guess I think that when "style" meant where to put the braces and how > the > fomatting is done, and existing variable names, and that sort of things, I > would definitely follow it. No question. > >> >> If I'm going to be in and out, I have no traction >> to change the existing style, and I'm not going to >> try to do it "under the covers". > > Ah. Yes, I understand that. > > > >> I may very well >> make suggestions, try to get people moving in a >> direction that I think is a bit more useful, and >> so forth, but it's not my place to make unilateral >> changes in a development unit's agreed on coding >> style - even if it s3s rocks. > > Ah. What if it wasn't agreed-on by a development unit, but was the work > of > one programmer, who has since learned much better, and says so? If it's > more than formatting, but the use of huge amounts of duplication, > unreadable > variable names, SQL in the GUI code and so on? Stylistic hodgepodges are fair game, however sometimes there are other issues. A particularly unreadable variable name may be part of the background as: "this is the one you've got to be real careful of," and SQL in the GUI code may be the way people do things; the alternative may require a learning curve. Lots of little issues go into style, and some of the least obvious will trip you up. > > I'm not disagreeing with you at all... I think to keep a job or fulfill a > contract one might have to use the same style as the existing code. > Trouble > is, now that I'm seeing that stuff is bad (and or unreadable) I really > hate > coding that way. > > In some cases, each new project is done better, but maintaining the older > projects becomes a nightmare. And if one starts out writing bad code, > isn't > that setting a precedent for the type of work they expect later? > > I guess I'm looking for a better motivation for following an existing > style > than my paycheck... Well, my impulse is to yell, "hey Stash, what's going on here?" and when Stash comes over to look, ask about changing whatever is bugging me in a quieter voice. The odds are, he'll agree if it's really a mess. John Roth > > Kay > > > > > To Post a message, send it to: [EMAIL PROTECTED] > > To Unsubscribe, send a blank message to: > [EMAIL PROTECTED] > > ad-free courtesy of objectmentor.com > Yahoo! Groups Links > > > > > > > > To Post a message, send it to: [EMAIL PROTECTED] To Unsubscribe, send a blank message to: [EMAIL PROTECTED] ad-free courtesy of objectmentor.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/extremeprogramming/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
