Rob Garrett - Blogs

Welcome to Rob Garrett - Blogs Sign in | Join | Help
in Search
Google

Software/Technology Discussion

Software and Technology Tid-bits

How many bad developers are there in the world?

As I was reading today's "Daily WTF" I could not help but wonder about how many really bad developers are out there in the market place. The following snippet was submitted to D-WTF after being found in some production code:



Ok, the average coder knows that this entire function can be replaced with if (bool) {}. So, who are these people that spend their time writing functions to replace built-in language logic? Why are they employed? Who is interviewing them and giving them work in the software arena?
Share this post: Email it! | bookmark it! | digg it! | reddit!
Published Friday, July 29, 2005 10:06 AM by Rob Garrett

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Miki Watts said:

From my experience, this kind of code usually originates from people who took economics or similar courses in university or college, and think that they know how to write code. Fast forward a few years later, and that's the result.
July 29, 2005 12:43 PM
 

Rob Garrett said:

Maybe, but I've also seen developers with a BSc in Computer Science produce code like this. I guess software engineering is like any other profession - there are those that take pride in their work and do a good job, and those that either don't know or don't care.

July 29, 2005 4:09 PM
 

G Bickham said:

"Let him who is without sin cast the first stone ..."

I don't see anything wrong with this (if it works) ... Sure, this developer could have easily done a google search to find a better approach.But would that have made him/her a better developer. What I see from this code is someone who was thinking outside of the box. Which is a good sign that this person will eventually mature into solid developer.

I think the bad developers are those who COPY code without even taking the time to understand why it works ...

If we all just think back to when we were writing our first apps then we would better appreciate code like this. I wonder how many of those apps are still in production and are still being used?
August 4, 2005 12:31 PM
 

Rob Garrett said:

G-Bickham,

First of all, I was not the first one to cast the stone, if you read Daily WTF (or even know what it is), heck if you just read my post again you'll see that I am passing further comment to a rant that someone else has already posted.

Secondly, how can you say there is nothing wrong with this code? The developer is obviously unaware that you can perform a simple boolean comparison, without the need to write a helper function and/or a wrapper class for built in boolean types.

Okay, there may be a good reason why the developer wrapped a built in language type and requires this method to compare the internal value. Why not just return the value of bool.booleanValue() and do away with the condition?

So let me get this right, your suggesting that we can chalk up bad code, such as the example above, to beginners luck? Unfortunately code like this is in production today, which is why 50% (or more perhaps) of the market is awash with crap software.
August 4, 2005 1:30 PM
 

Eli Allen said:

The function itself is very simple so can be easily inlined which means no function call overhead. for example:
int square(int x)
{
return x * x;
}

Is in no way inefficient.
http://blogs.msdn.com/ericgu/archive/2004/01/29/64644.aspx

A good programmer profiles if they want performance, assuming/guessing isn't allowed because of how much happens behind your back. Better to write easy to understand code with good algorithms then care about the number of function calls.

Look here for an example of inlining you may not have expected:
http://blogs.chimpswithkeyboards.com/jonshute/archive/2004/05/17/156.aspx

Without seeing any other code this person wrote or knowing anything about them isn't it possible that they had extra time so thought they would obfuscate their code for fun?
August 4, 2005 9:27 PM
 

Ewald Krämer said:

Is it possible the developer built that code because of frustration ?
I just can't imagine that even a bad developer wouldn't see the
performance loss.
March 28, 2006 9:28 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit

Blurb


Head Shot
Rob Garrett is a British Expat living in Maryland USA. Rob is a trained software engineer and experienced in Windows .NET development.

Rob enjoys listening to Rock music, posting to blogs, driving in the country with the sunroof open, beer (not in conjunction with country driving) and spending time with his family.

This Blog

Syndication

Powered by Community Server, by Telligent Systems