Advertisement

Would you release bad code?

Started by October 25, 2009 10:12 PM
27 comments, last by WazzatMan 15 years ago
Quote: Original post by Ravuya
I wouldn't call 95% of the stuff out there in open source to be "perfect code," either. Not if it has a usable product at the end of it.

This has been my experience also. If you fear your own code is bad, compare it to other open source projects. Maybe it's not that bad :).

You should think of the positive sides too. Maybe someone will give you tips on how to improve your algorithms or maybe they will do it for you :). Also since it's public, the thought of somebody reading you code will always gnaw at you, making sure you don't do ugly solutions so frequently in the future :P
I wouldn't say the code must be 'perfect' in order to release it, but frankly, no, I wouldn't release any code that I have written. I think it's bad enough that there's really no need for it. On occasions people have asked me for source from some of my projects, and still I was relunctant to reveal it to them. It may work and do useful things, but that's why you release binaries and not code. Sure, there's a lot of bad open source projects out there, but I'm not particularly interested in contributing more bad code. So, no.
Advertisement
Your code is probably better than you think it is, because you are going to be your harshest critic. And even if it has some imperfections, almost every open-source, non-community-created program does. And as the above poster said, having too many comments is rarely a problem. Unless you are writing letters to your friends in the middle of your application, or the viewer has to scroll through 5 pages of comments just to see 1 line of code, I wouldn't worry about it. Most applications have too few comments.
Quote: Do you know what's embarrassing to real programmers? Working on a hobby for x years and not having anything to show for it.

So true.

Theres also thew minor thing that 'Perfection is impossible'
I hear Torque's source is a godawful mess, yet they have a pretty sizable following....
Quote: Original post by HostileExpanse
I hear Torque's source is a godawful mess, yet they have a pretty sizable following....


You know, there's messy code, and then there's MESSY code. What most people here consider 'awful code', in my eyes it's mostly fine. I bet you can pick the worst coded open source project and compared to my code it will be a beauty. Say I write a game, I write entity logic in random places all over the place. You really haven't seen bad code if you haven't seen my code :P
Advertisement
Release it. You're reluctant to release it because you feel you'll be embarrassed by how "bad" the code is - because, you know, less-than-genius code is not becoming of someone of your stature.

Just last week someone in #gamedev pointed us to this Google IO talk:
">The Myth of the Genius Programmer
. It's an hour long, but I think you should watch at least the first 15 minutes and promptly disabuse yourself of your anxiety.
The code has to be really awful in order to be worthless, opensource software is never less valuable to the end user than equivalent closedsource software, and quite often its more valuable, The only questions you need to ask yourself is:

Do you want to give you users/customers that extra value ?
If so, do you want anything from them in return or limit how they can use it ?
Is the code really so bad that its embarassing ?

The only reason not to give away your code imo is that its too valuable to be given away freely.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Quote: Original post by Oluseyi
Just last week someone in #gamedev pointed us to this Google IO talk:
">The Myth of the Genius Programmer
. It's an hour long, but I think you should watch at least the first 15 minutes and promptly disabuse yourself of your anxiety.


Thanks for that link.
Quote: Original post by HostileExpanse
I hear Torque's source is a godawful mess, yet they have a pretty sizable following....


OGRE uses singletons all over the place. And many people here think its a bad practice. I've been playing with the Playground SDK and it makes quite a bit of use of singletons. But it seems to have quite a bit of a niche following in casual games.

"Bad" is relative. Judging from all of the nitpicks on various different practices you see on these forums most commerical software probably isn't "good". It does the job and thats the most important thing when you have a deadline. If programming is just a hobby and it gets done when it gets done then you have a bit more time to work on perfect code.

This topic is closed to new replies.

Advertisement