Saturday, September 23, 2006

» Conventional wisdom +

The conventions of a given community of programmers are usually time-tested and often they make life much easier on the programmer. For example, the convention of writing self-documenting code rather than using one or two letter variable names is a very helpful guideline.

But as with many other issues, what is generally beneficial and a good practice for most people in most situations gets promoted to the absolute best thing for everyone always. And anyone who doesn't think so is either a bad programmer or is stupid for departing from the conventional wisdom of the community.

It seems to me that this kind of thinking can lead to stiffling creativity and growth in problem solving. You just can't get your head around approaching a problem in a different way than the common way (i.e., "only right way"); you'll say "why do you want to do it like that, you should do it like this!" (I've seen this happen many times; regarding everything from XHTML to JavaScript to python to ruby).

And what is silly is that many of these conventions are simply matters of personal taste: for example, coding style. But yet people are instructed that it is best to ignore their own prefered coding style and to just follow along with the community, because the way the community likes it is The Right Way®™; and should the person not follow the conventions of the community, then they must be trying to "program in a different language". "Haven't you read PEP 8?!" it is asked in awe and reverence of the almighty style guide.

Or, when something really is a bad idea sometimes; people get all fearful and turn that into every time. "What? You use...eval?" it is intoned in frightened, hoarse half-wispers, lest the devil drag you into hell for mentioning the name of his son. Oh, but instance_eval is fine though(!).

I'm not some kind of rebel iconoclast, standing against everything conventional. I like most of our conventions, actually. I just don't like it when we cling to them so tightly we refuse (or literally cannot) look past them to mabye improve them or find something better; or when we take what amounts to subjective preference and make it the absolute "right way" to do things; or when we get so worried we'll do something wrong we make it harder to do something right. Uh, yeah. That's about the long and short of it, heh.

And of course, I never do any of that; you see, I have this convention that says... ;)

Labels: , ,

0 Comments:

Post a Comment

<< Home