Advertisement
Promo

Become a member of the ZDNet UK community

Jonathan Bennett

View blog's RSS Feed

Beyond the Code

or, how to win friends, influence people and make a living by writing open source software. It's not just about the code.

Follow me on Twitter as @jonobennett.

Friday 24 April 2009, 1:36 PM

Open source coders aren't lazy enough

Posted by Jonathan Bennett

My enthusiasm for open source software partly stems from the times I've spent as a coder, where being able to reuse code for a particular task made my life much easier. Free licensing of code makes this easier across a wider group of developers — choose the right licence, and anyone in the world can share with you.

When I learned Perl, way back when that was what you wrote web applications in — forgive me if I'm showing my age — I learned the "three virtues" of a programmer from the Camel Book: Laziness, Impatience and Hubris. The laziness talked about there was that of using a small amount of extra time when creating code to save yourself lots of time later: Document your code so you don't have to answer the same question about it over and over and over. It's a fantastic principle, and it needs more application by everyone.

I arrived at one such programming job to find that they had written their own HTTP user agent in Perl. There weren't any noticeable bugs in this implementation, but it has taken time to write and didn't have anything like the level of functionality of the LWP module, widely used to do the same job and easily downloadable from CPAN. There were other examples of where other code could have been reused, but there wasn't a culture of finding source code to reuse at the company — the attitude to open source was that you used the finished product — object code — but wrote any new code you needed yourself.

Sharing code is a natural and useful activity for developers, whether that's just amongst coders at one organisation, or with every other user of the language you're writing in. While making sure you share your code is generous, and an important part of the system, you should make use of the other side of the bargain — the ability to use code others have shared with you. The principle of enough eyeballs making all bugs shallow only works if all the eyeballs are looking at the same piece of code.

It's disheartening therefore to see lots of open source projects being started that are very similar to lots of existing projects. Read through a site like Freshmeat and you'll see lots of very useful projects like software build tools, project management systems, network utilities, all of which vary from similar projects in functionality by a few per cent. The user interface may be different, but what the code does will be incredibly similar. The real problem with this is that each codebase will have its own set of bugs, and if a problem is fixed in one, it won't get fixed in the other. This isn't making the best of what open source has to offer coders or users.

My message to open source coders is this: Get lazier. When starting to write code, you should always assume someone else has written it first, all you have to do is find where. Invest that extra time looking for it, and you may save yourself far more time in writing, debugging and maintaining it later.

Comments on this post

Jonathan Bennett

This member is ranked #12 in our top 100

  • Jonathan Bennett
  • Applications Development, London
  • Member since: October 2006

Site Activity Rating 5

CoreTechs

Contacts' Latest Discussions

Number of Tracked Discussions: 1,966

ator1940 ator1940

Personal Financial Management Software...

Wednesday 9 December 2009, 10:00 AM

3 comments
Jake Rayson Jake Rayson

A Tempest in a Nostalgic Teapot

Friday 4 December 2009, 2:39 PM

2 comments

Contacts' Latest Blogs

Number of Contacts Blogs: 18

Avatar Adrian Bridgwater

The Sun Java EE Also Rises

Tuesday 8 December 2009, 11:00 AM

0 comments
Avatar Karen Friar

HP workers set dates for strikes

Thursday 3 December 2009, 7:57 PM

1 comment

Skip Sub Navigation Links to CNET Brand Links

Help

Become part of the ZDNet community.

Newsletters