From: Robert Klemme Date: 2006-05-02T02:14:02+09:00 Subject: Re: OT: Convention (was: how to use curly brackets vs. 'end' in Ruby) 2006/4/30, Elliot Temple : > > On Apr 30, 2006, at 11:39 AM, Logan Capaldo wrote: > > > > > On Apr 30, 2006, at 2:26 PM, Elliot Temple wrote: > > > >> Robert Klemme wrote: > >> > >>> I wonder how a convention can be wrong. This may sound like > >>> linguistic > >>> nitpicking, but the whole point of a convention seems to be that > >>> it's > >>> adhered to. It just "is" but can't be right or wrong IMHO. There > >>> might > >>> be more and less usable and easier and more complicate conventions - > >>> but right or wrong? > >> > >> How about Sati > >> > >> http://en.wikipedia.org/wiki/Sati_(practice) > >> > >> Or stoning adulterers to death. > > > > Whoa. How about we all pretend their was an implicit "coding" in > > front of the word "convention" for the last couple of posts? I > > think Mr. Klemme was wondering how a coding convention can be wrong. > > How can a (coding) convention be *wrong*, instead of just less > useful, less practical? > > The same argument applies to other conventions. Why is Sati *wrong*, > instead of just a less useful, less pleasant way to live? > > Ideas have broad consequences that can't be arbitrarily restricted: > they reach out to other fields. The full answer to the Sati case > should include whether anything is wrong at all, and whether > practical considerations have moral consequences. Those issues are > important to the question about coding. > > We can even take a dialog about Sati, and then use some of the ideas > to argue about coding. Most of them will work just as well about > either topic. > > Jim: "Sure, Sati sounds horrible to us, but they are accustomed to > it, and would be unhappy to live another way. It has practical > consequences, like reducing how many women are available to knit, but > wealth is only a convenience." > Chloe: "Medical textbooks are a kind of wealth, and medicine matters. > With less knitting, they won't be able to buy as high quality medical > books." > > So, back to coding. This medical textbook argument will work great. > Some programmers write tools for doing page layouts, and for making > diagrams. Those tools help us make better medical textbooks. The more > convenient and practical the coding conventions of the programmers, > the sooner we will have higher quality medical textbooks. > > The idea that medical textbook production is a *practical* issue with > *moral* consequences can be transplanted just fine between the two > cases: it has reach. > > This isn't conclusive, of course. Maybe you don't see the moral value > in medicine. But I think it's getting somewhere, to tie those things > together. Most of us are probably persuaded by now. And if we were to > continue on, about Sati, or coding conventions, we'd continue on in > exactly the same way -- discussing medicine -- because it's all tied > to the same issue now. Now, this has become an interesting discussion! Let's take this a bit further and maybe put some things into perspective. Right or wrong can only be decided based on a set of values. We (at least I assume you're with me here :-)) consider Sati "wrong" because it contradicts some fundamental value of our society (I won't go into the discussion of universam human rights...) - that of life itself. Now, with software we're far more flexible with regard to values to base a decision on. For some it's somehow derived from financial values (i.e. development effort it took to code it in the first place, cost of maintenance etc.), for some it's more aesthetic (shortness, symmetry etc.). I personally view it mostly from the first perspective and to some degree from the second. Since *any* coding convention (i.e. a practice that *most* people of a domain adhere to) helps in understanding code it's *right* from a financial point of view. If you try to replace an existing convention this will incur some cost - if you achieve it at all. The cost depends on the number of people involved and the amount of software that needs to be changed to implement the new convention (this includes development software like IDE's etc.). The confusion by a convention change might even cancel out the effect of a convention at all, i.e., since there are now two conventions none of them has the power to aid understanding etc. any more. Just imagine what would happen in someone would try to replace the iteration method's name "each" with some other name. Woa, this has become fairly theoretical. To sum it up: a bad code convention is better than no code convention. Or put it another way: there's a reason why it's so hard to get rid of conventions... Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/