At some point in nearly all semi-big programming projects I undertake I find myself "lost" and unsure of how to proceed without blowing it all up in little pieces. So I was wondering if anyone had any suggestions on how to plan ahead properly before sitting
down and typing the first line of code.
(This coming from a poor programmer who works alone, developing C# applications using VS .NET)
At some point in nearly all semi-big programming projects I undertake I find myself "lost" and unsure of how to proceed without blowing it all up in little pieces. So I was wondering if anyone had any suggestions on how to plan ahead properly before sitting down and typing the first line of code.
I like to flow the program out on a piece of paper first. I draw up a flowchart to illustrate how the program may flow.
Doing so usually helps me point out what type of error checking needs to be included in the process. And/Or identify each piece of the program that is required.
Probably like most developers here over the years you begin to "think" like a computer.
I also work alone.
I don't like methods like UML, they overcomplicate the often medium-complex applications we're building. Just like JAnderson, I prefer just getting a piece of paper and draw out the workflow as *my* mind sees it, using symbols (c) me
For relatively small fragments of code (functions, routines, algorithms), I often use a quasi-programming language that describes 'what' happens 'when', like this:
retrieve value (int); is it > 0?
- no ->
- yes ->
do this, blah, lookup using sql query
- no ->
- yes ->
etc. etc. It helps me see the logic, and then I just fill in the gaps with real code, and add comments to clarify it for other devs - as likely no one but me will understand this
I highly recommend looking into Test Driven Development (TDD). This method of programming has drastically reduced how I code and the end product is 10x better than before. It's actually quite amazing how the design comes out of the work.
Combining this method with other parts of extremem programming has made me grow as a developer leaps and bounds. In the end I am much happier with the code that I produce. Regression testing is a snap which is a god send.
For more information check out http://www.testdriven.com as well as http://www.nunit.org/ for your start.
For more info on XP see http://www.xprogramming.com/
There have recently been some really good MS press books on the subject. Ward Cunningham who is also a member of channel 9 has been behind alot of these.
Post removed at user's request.