One thing I have been asking myself quite often lately: “Why do – even popular – open source projects often have mediocre coding standards?”
My first thought was: Ok, most likely many of the projects were written by non IT-professionals who only code “out of their head” without thinking things through at first. Curious as I am, I googled for the very title of this post. And I fell across an article on Linux Today about a study done by the Boston Consulting Group (Also quoted on slashdot). What I found particularly disturbing was the finding that the most part of the interviewees considered themselves as IT-Professionals. Granted, only interviewing less than 600 developers from only one source (sourceforge), is barely representative, and most likely highly biased as well. But it’s an interesting survey nonetheless.
So, why – in the love of $deity – do so many projects written by allegedly IT-Professionals present themselves with very poor coding style and more often than not very poorly designed database schemata? It’s becoming an increasing nuisance to work with these projects. If you want/need to make changes/extensions to the existing code you often need quite a while to get to grips with the logic behind all that exists.
Interestingly though, the stricter the rules of the used programming language/database the better the code, but the less common it is as well in open source projects. This does not mean though that it’s the fault of the programming language. Not at all. Even with a language as flexible as Perl you still can write very sexy code. But I haven’t seen a single Perl script that fit’s that description (though I haven’t inspected many Perl scripts yet in detail).
I would really like to see a study on the demographics of open source software that focusses it’s goal on coding style/standards rather than on the age group / motivations of coders. And it should also pick a representative sample of developers instead of going the lazy route and only querying sourceforge. This would certainly be an interesting project to do 😉