Jump to content
  • Advertisement
Sign in to follow this  
u1bd2005

What's your programming style?

This topic is 3796 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

Ok, just wondering what peoples programming styles are? Are you someone who plans everything before hand and make sure that you can think of a solution before you start programming. Or are you someone who doesn't plan much and dont try to find a solution until you reach the problem. MY style Me, I tend to make notes on my game before I start, such as features I would like to include etc... I don't worry about if the solution, once I have enough notes on what I want I start programming and work my way through the features finding solutions when I am presented with a problem.

Share this post


Link to post
Share on other sites
Advertisement
Depends on the scope and nature of the problem.

Generally I'll think through a problem during the slow parts of the day (bathroom, shower, driving, boring tv, waiting for food) until I'm reasonably comfortable with the solution. Sometimes it requires jotting things down and notes, but that's rare. Then I'll implement things.

The key there is being sure to break problems down into ~3 hour chunks of work at a time.

Share this post


Link to post
Share on other sites
I usually delve into programming first.Code a few hours like mad to implement what I want.Then after getting the result and messing everything up I start cleaning things up :)

Share this post


Link to post
Share on other sites
I do this

Quote:
Original post by Black Knight
I usually delve into programming first.Code a few hours like mad to implement what I want.Then after getting the result and messing everything up I start cleaning things up :)


but am working towards making myself do this

Quote:
Original post by Telastyn
Generally I'll think through a problem during the slow parts of the day (bathroom, shower, driving, boring tv, waiting for food) until I'm reasonably comfortable with the solution. Sometimes it requires jotting things down and notes, but that's rare. Then I'll implement things.

Share this post


Link to post
Share on other sites
I often make notes and sketches first - it's a habit I developed during my time as a level-designer. It works for programming too so I've kept it. Then, depending on the task at hand, I'll make a prototype, or if I'm familiar with the subject, I'll start writing production code right away.

Share this post


Link to post
Share on other sites
I spend time thinking over problems and deriving possible solutions in my head then, once I think I've found one that's satisfactory, I prototype the solution in a project all of its own. The idea is that not only do I begin coding with a near-ideal solution in mind but I'm forced, due to the prototyping, to keep things modular and loosely coupled.

If the prototype fails initially, I either refactor it to make it work or go back to thinking up new solutions with the added knowledge of what didn't work from the failed prototype.

Share this post


Link to post
Share on other sites
I usually try to split the task into several smaller ones, this usually results in modulate code that is far easier to test than a full blown class that does almost everything and due to the nature of modules it also makes for shorter compile times.

Before I start writing any code I try to fully understand what I am going to program(the algorithms, some potential pit falls...)
after this I examine the algorithms to get an idea about which containers to use ... and finally I try to get rid of redudant computations and if possible try to rewrite algorithms to make them suitable for parallel processing, you know the many cores systems we will have in a few years.


Some of these steps can t be thought of in advance, so you will have to refactor your code once its working.
The final result is usually pretty reuseable code and saves time on the long run.

Just a note: Never start to work on multiple modules of a task in parallel, finish one first, its far easier to debug one module, than to find bugs that are caused due to interaction of incomplete modules.
Just write some simple helper modules if you really need them to get the previous task done at all.

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
Generally I'll think through a problem during the slow parts of the day (bathroom, shower, driving, boring tv, waiting for food) until I'm reasonably comfortable with the solution. Sometimes it requires jotting things down and notes, but that's rare. Then I'll implement things.


I thought I was the only person who thought about programming in the shower! [smile]


Share this post


Link to post
Share on other sites
Game wise I take a more flexible and agile approach. First I will write down a general overview of the game. Basically a anorexic design doc. It is only about 1 paragraph or so long and lays out the basics of the game. IE read my journal here the entry about the orbis overview. I will then implement that stuff and I have the main core of the game. From there I go and start adding features to make the game more full/polished. The reason I do it this way is because I find it easier to manage and develop a project without knowing everything you want it to do. If I start doing a severely detailed design I get carried away and it make the project exponentially harder to work on. I would rather see the project evolve in a flexible way which helps prevent features not making it or realizing the feature is imposible because you feel the flow of the game peice by peice. I think of code as art not science :D

Edit: Am I the only person who has solve a very hard to solve programming bug/error/and or algorithm in their sleep? Oh yes I think about programming in the shower, bathroom, and at work(rather dull job) all the time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!