What's your programming style?

Started by
31 comments, last by kiwibonga 15 years, 8 months ago
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.
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.
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 :)
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.
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.
Create-ivity - a game development blog Mouseover for more information.
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.
Devil May Cry's Smokin' Sick style!!!
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.

http://www.8ung.at/basiror/theironcross.html
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]


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.

This topic is closed to new replies.

Advertisement