The seven sins of programmers

The seven sins of programmers


[Click here for an expanded, updated version of this blog entry which hasnow been published in issue 17 of Free Software Magazine!]

Programmers. The system administrators worship their bit twiddling capabilities. The users exchange vast quantities of beer for new features and tools. And the project managers sell their soul when they make the magic work. But inside the average programmer's psyche are several demons that need exorcising.

Pride

This is all too common in programmers. Instead of asking whether a particular function exists, or for the best way to retrieve data from the system, a proud programmer is likely to write their own. Especially when faced with a large, or unfamiliar, code base. By re-inventing the wheel there are now two very similar routines. Not only does this increase the code size, it doubles the amount of maintenance required, creates another opportunity for bugs, and adds inconsistency. Later, when another programmer sees these two functions, they will have to choose between them. Which one will depend on their mood (are they also too proud to seek help?), who's on holiday or who's outside smoking, at the time! This can equally be applied to duplicate constants, member variables or structures.

Envy

Programmers should improve themselves by learning from others, not blindly emulating them. All coding methodologies (be they syntactical or design-based) come with caveats. A programmer might inline a function with the pre-processor because he's seen it done elsewhere, unaware of potential side effects, as in this classic example.

#define SQUARE(x)   x*x

Gluttony

Not an evening at the all-you-can-eat buffet, but the problem of writing too much code. Every hour spent coding will require an extra hour of testing, and possibly two more of maintenance. And guess who gets lumbered with the maintenance?

Worse still, this does not scale. A two-minute feature (or one line bug fix) may also take an hour to test. Whatever your gluttonous reasons are - attempts to impress, an under-staffed team, late night camaraderie, or personal pride - curb them. Spending the whole morning trying to unravel last nights two-minute feature is like the buffet - you get stuffed afterwards!

Lust

Programmers crave pleasure; they love to 'scratch their own itches'. If unchecked, some developers will write fantastic, innovative, original... and completely unnecessary, code. It could be a new graphics shader, a faster search algorithm or an entire processing engine! Make sure any code written is actually needed. Will it get used? Or will it distract the users who, in turn, add a new plug-in system, just to make use of the code? Is that particular search algorithm slow? Is it on the critical path? Do you need a new engine? Is middleware a viable solution? Have off-the-shelf components been rejected because it was "Not Invented Here"? Curbing programmer lust allows more time spent on the important tasks. Like the software.

Anger

Do not code out of anger. Do not ignore good ideas, regardless from where they come. If a more junior programmer has a solution to the problem in hand - discuss it. If it works - use it! The engine programmer should not be allowed to implement his own solution just because "He's the engine programmer".

Do not code out of spite. Lead programmers: love your coders. Code reviews, for example, should raise the ability of the whole team, and not be used for leads to show off, introduce new jargon, demonstrate obfuscated syntax or exhibit other prima donna characteristics.

Do not code out of fury. Programmers: love your leads. They distribute work because it needs doing. Don't work on somebody else's tasks because you're more suited, or believe it should have been yours. If you want to move into other areas of programming, talk to your lead. Develop prototypes at home. Employing enthusiasm in this manner will win more brownie points than ignoring the task list and schedule.

Sloth

Don't procrastinate! If a particular piece of code is uninteresting or difficult (like an obscure crash bug), more interesting tasks should be available to compensate. Also, make sure all the tasks are clear, consistent and given from one manager. Opposing requests from different managers will make one of them unhappy, and starting such a doomed task is no fun for anybody.

Greed

This final point is directed more towards management. Everyone should feel valued. Financially and metaphorically. This is especially true during crunch time, when even the most junior programmer can work out their hourly pay packet could be improved by working on the cold meat counter at Tesco! Paying for late night food goes without saying (I hope!), but an occasional pub evening also helps. This gets everyone out the office, showing that management aren't greedy with an employee's time, either. Leads should check for warning signs, like 'funny' comments in the code - "I'll do this properly when I get a fscking pay rise!!!". Follow Dilbert. Less money for staff does not mean more for management.

Naturally, the lead programmer should help prevent such sinful practises. But as responsible professionals, we should all try and curb the devil inside first.

Category: 

Comments

Mike Foster's picture

Not all programmers are like that!

Hmm, maybe "Denial" should have been up there too - LOL!

l0b0's picture
Submitted by l0b0 on

Much redundant or complex code could have been avoided in the first place with some training. For one, familiarity with the available libraries can preempt re-inventing the wheel. Programmers are also bound to pick up good habits from one language, which can be bad habits in another.

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

"If unchecked, some developers will write fantastic, innovative, original... and completely unnecessary, code. It could be a new graphics shader, a faster search algorithm or an entire processing engine!"

You pretty much summed up free software and then threw it out because it doesn't meet your consumer needs.

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

I'm not sure quite why 'Copyright information' is listed as the 8th sin, but I'm sure there is someone out there who agrees vehemently with that....

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

I'm going to leave my job and look for another only because my team is paying for the whole sins, and I can't hold anymore. I commented many improvements in our meetings that nobody would heard seriously, maybe because I'm the younger (21) and so on. Actually they're "discovering" these tricks that most of times I said in the meeting. Personally I don't think all my proposals are better but at least they could take consideration on them... Envy, Pride or the whole sins?

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

I kindda agree with that, have seen some of those personalities. but not all programmers are like that.
that's true complex code should be avoided, what is more important is one should welcome the ideas and logic, solution from all, doesn't matter whether one is jr or sr.

Nilesh Joshi
Sr. Software Engineer,
BancBridge

Anonymous visitor's picture
Submitted by Anonymous visitor (not verified) on

some of the signs are true, but not all, different people may have different attitudes. Anyhow, nice to raised them :p

Aaism N. Siddiqui
software Engineer
sigmaTec Solutions
Lahore Pakistan
http://www2.webng.com/a4ans

Author information

Steven Goodwin's picture

Biography

When builders go down to the pub they talk about football. Presumably therefore, when footballers go down to the pub they talk about builders! When Steven Goodwin goes down the pub he doesn’t talk about football. Or builders. He talks about computers. Constantly...

He is also known as the angry man of open source.

Steven Goodwin a blog that no one reads that, and a beer podcast that no one listens to :)

Most forwarded

Interview with Dave Mohyla, of DTIDATA

Dave Mohyla is the president and founder of dtidata.com, a hard drive recovery facility based in Tampa, Florida.

TM: Where are you based? What does your company do?
DTI Data recovery is based in South Pasadena, Florida which is a suburb of Tampa. We have been here for over 10 years. We operate a bio-metrically secured class 100 clean room where we perform hard drive recovery on all types of hard disks, from laptop hard drives to multi drive RAID systems.

Anybody up to writing good directory software?

Since the very beginning, directories (of any kind) have had a very central role in the internet. (I have recently grown fond of Free Web Directory. Even Slashdot can be considered a directory: a collection of great news and invaluable user-generated comments. As far as software is concerned, doing a quick search on Google about software directories will return the free (as in freedom) software directories like Savannah, SourceForge, Freshmeat and so on, followed by shareware and freeware sites such as FileBuzz, PCWin Download Center and All Freeware (great if you're looking for shareware and freeware, but definitely less comprehensive than their free-as-in-freedom counterparts).

Interview with Mark Shuttleworth

Mark Shuttleworth is the founder of Thawte, the first Certification Authority to sell public SSL certificates. After selling Thawte to Verisign, Mark moved on to training as an astronaut in Russia and visiting space. Once he got back he founded Ubuntu, the leading GNU/Linux distribution. He agreed on releasing a quick interview to Free Software Magazine.

Is better education the key to finding better software?

I read David Jonathon's article Anybody Up To Writing Good Directory Software? the other day, which got me thinking about software directories in general. As David mentioned, many of the software directories one finds when doing a quick google search are free as in beer, not as in freedom. But what interests me is the software directories that already exist, providing a combination of both free as in beer software, and open source software. Sites such as Freeware Downloads and Shareware Download don't advertise themselves as providing free as in liberty software, but each of them have a good selection of open source software available... if you know where to look.

Most emailed

Free Open Document label templates

If you’ve ever spent hours at work doing mailings, cursed your printer for printing outside the lines on your labels, or moaned “There has got to be a better way to do this,” here’s the solution you’ve been looking for. Working smarter, not harder! Worldlabel.com, a manufacture of labels offers Open Office / Libre Office labels templates for downloading in ODF format which will save you time, effort, and (if you want) make really cool-looking labels

Creating a user-centric site in Drupal

A little while ago, while talking in the #drupal mailing list, I showed my latest creation to one of the core developers there. His reaction was "Wow, I am always surprised what people use Drupal for". His surprise is somehow justified: I did create a site for a bunch of entertainers in Perth, a company set to use Drupal to take over the world with Entertainers.Biz.

Update: since writing this article, I have updated the system so that the whole booking process happens online. I will update the article accordingly!

So, why, why do people and companies develop free software?

More and more people are discovering free software. Many people only do so after weeks, or even months, of using it. I wonder, for example, how many Firefox users actually know how free Firefox really is—many of them realise that you can get it for free, but find it hard to believe that anybody can modify it and even redistribute it legally.

When the discovery is made, the first instinct is to ask: why do they do it? Programming is hard work. Even though most (if not all) programmers are driven by their higher-than-normal IQs and their amazing passion for solving problems, it’s still hard to understand why so many of them would donate so much of their time to creating something that they can’t really show off to anybody but their colleagues or geek friends.

Sure, anybody can buy laptops, and just program. No need to get a full-on lab or spend thousands of dollars in equipment. But... is that the full story?

Fun articles

Santa Claus - the most successful open source project

It dawned on me the other day, as I was shopping for the dozens of gifts it seems I have to buy every December, that Santa Claus is the most successful open source project in history. (Bridget @ Illiterarty would agree with that). Santa Claus is essentially a marketing development that is embodied by everyone who stuffs a sock, gives a gift, hosts a dinner or wishes Merry Christmas over the holiday season.

Most emailed

Editorial

When I first started thinking about Free Software Magazine, I was feeling enthusiastic about the dream. I had Dave, Gianluca, and Alan willing to help me, I had established members of the free software community willing to help me out, I had writers volunteering their time and energy for free, and I had a generous offer from OpenHosting for servers, all before I'd proved myself. There was a sense of excitement in the air, and I thought maybe, just maybe, I could make this work.

Free Software Magazine uses Apollo project management software and CRM for its everyday activities!