Sign in to follow this  

Frankenstein Code

This topic is 4299 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was getting on to post about my game in progress and noticed the Plasma Pong game in the recent galleries section. My game is a pong clone and I was thinking it was pretty cool, not the best, but mine. I hate how people make programming look so easy sometimes. Anyway, when does a programmers code stop looking like something made from Dr. Frankenstein to something like a super model? And when getting close to the end of a project and you realize that it could have been set up and designed cleaner and more efficiently, should you scrap your project and code it right?

Share this post


Link to post
Share on other sites
Quote:
Original post by klayAlloy
Anyway, when does a programmers code stop looking like something made from Dr. Frankenstein to something like a super model?

When you've rewritten it 6-7 times, I'd say... Usually, the best you can hope for is decent readable code.

Quote:

And when getting close to the end of a project and you realize that it could have been set up and designed cleaner and more efficiently, should you scrap your project and code it right?

Ideally, you should realize this long before the end of your project, and gradually refactor and clean up.

Once you get near the end of your project, you might want to just finish the damn thing before starting on the new improved version.

Share this post


Link to post
Share on other sites
Quote:
Original post by klayAlloy
I was getting on to post about my game in progress and noticed the Plasma Pong game in the recent galleries section. My game is a pong clone and I was thinking it was pretty cool, not the best, but mine. I hate how people make programming look so easy sometimes.


Don't be affraid and post your code. Better: register a GDNet+ acount and add your pong to the showcase :)

Quote:
Original post by klayAlloy
Anyway, when does a programmers code stop looking like something made from Dr. Frankenstein to something like a super model?


Experience, experience. Beeing able to write good code requires some knowledge of what good code is exactly, and this knowledge comes from your experience :)

Quote:
Original post by klayAlloy
And when getting close to the end of a project and you realize that it could have been set up and designed cleaner and more efficiently, should you scrap your project and code it right?


The decision is up to you. If you feel you can rewrite it and if you have the will to do so, then yes, do it - especially if you are still in your learning phase.

Regards,

Share this post


Link to post
Share on other sites
Quote:
Original post by klayAlloy
I was getting on to post about my game in progress and noticed the Plasma Pong game in the recent galleries section. My game is a pong clone and I was thinking it was pretty cool, not the best, but mine. I hate how people make programming look so easy sometimes.

did it occur to you that those people might be actually experienced, you shouldn't try to compare your work to anybody's else's unless it was a fair competition , if you were asked to make a hello world app when you have been programming for a while wouldn't it look easy but the guy that just started programming would think it was hard cause he got no experience about the subject so you shouldn't hate when something looks easy to others and hard to you cause someday the roles will be swapped and you will be hated for being good.

Quote:
Original post by klayAlloy
Anyway, when does a programmer’s code stop looking like something made from Dr. Frankenstein to something like a super model?


When you read a book about design or you come up with your design pattern, but for beginners it's nearly impossible to think about this before they actually see the mess poorly designed code creates.

Quote:
Original post by klayAlloy
And when getting close to the end of a project and you realize that it could have been set up and designed cleaner and more efficiently, should you scrap your project and code it right?

this would be a simple process of analysis, you should see if the optimization of the code would have any effect on the project other than the code looking neat, but if bugs are found they would harder to extract if your code wasn't optimized so make an objective analysis and see how much your optimization would effect the result and if it's worth it to keep the project under development for more time.

Share this post


Link to post
Share on other sites
Quote:
Original post by klayAlloy
I was getting on to post about my game in progress and noticed the Plasma Pong game in the recent galleries section. My game is a pong clone and I was thinking it was pretty cool, not the best, but mine. I hate how people make programming look so easy sometimes.


Indeed. Don't worry though, there's always someone worse.

Quote:

Anyway, when does a programmers code stop looking like something made from Dr. Frankenstein to something like a super model?


Personally, I've never seen supermodel code. Just decreasingly ugly. [imo]

My own code has just recently gotten tolerable after maybe 5 years of constant writing and more than a decade less constantly.

Quote:

And when getting close to the end of a project and you realize that it could have been set up and designed cleaner and more efficiently, should you scrap your project and code it right?


No. If you're close to the end, you should finish it. Finishing projects is a good habit that far too few programmers seem to have.

Share this post


Link to post
Share on other sites
Thanks for the comments. I appreciate most of them. The one about hate could get dropped for the better of this section of forum. People make mountains out of mole hills a lot, that's cool though. Thank you all again.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
ugly code is mostly the product of bad design or incompetent programmers. But in the end what is important is if the application runs acceptably not how the code looks.

Share this post


Link to post
Share on other sites
Quote:
Original post by klayAlloy
Thanks for the comments. I appreciate most of them. The one about hate could get dropped for the better of this section of forum. People make mountains out of mole hills a lot, that's cool though. Thank you all again.


Did you refer to my post? I don't understand, what is mountains out of mole hills? Anyway, it's good to know it does get better, it helps to to compare some old code with the current code one writes. That goes for lots of things where learning is involved, sometimes you need to see exactly how far you have come.

Share this post


Link to post
Share on other sites
Realize that even the best coders can produce crappy code. It's all about getting lazy. With that said as a beginner don't worry about having pretty code, that will come over time with more practice and experience.

Share this post


Link to post
Share on other sites
My two cents:

I'm writing my game engine in OpenGL. I'm encapsulating the functions in a DLL for ease of modification (plus to get experience in writing a DLL).

So far, my program and DLL display a couple triangles in a window, and some text which was basically lifted off of NeHe lesson 13 and then modified for my uses.

I'm on build 1500(conservative), I think; I lost count around late December at 400-500+, and I've been working on it constantly since. These aren't "change one line" builds, these are code changes with major bug fixes or redesigns. I've redesigned the structure of the code for just the window creation seven times, 3 procedural and then 4 object-oriented with interfaces.

The code started off so ugly I had comments in the code declaring it as such. Now, it's a lot better, but still pretty hideous. It's just constant improvement.

Best of luck,
Aviosity

Share this post


Link to post
Share on other sites

This topic is 4299 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this