Archived

This topic is now archived and is closed to further replies.

Idea -> Code

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

If I have an idea and I want to test it, what is the correct procedure for translating that idea into code? I don''t like structured programming because if the idea has any amount of complexity things tend to get messy quickly, which tends to be buggy. I like object oriented ideas, but then I often find it hard to fit my ideas into terms of objects. For example, does this function go with this object, or does this function need it''s own module? How far do you take the object oriented approach? Do I create a class to keep track of which player''s turn it is? What can I do to solve my problem of taking an idea and implementing it? Is my problem in understanding software design? Or am I misunderstanding (or don''t understand enough) about OOP? I''m confused...help! Russell

Share this post


Link to post
Share on other sites
Grab a piece of paper and a pencil or use your whiteboard and write out the algorithm for your idea/game. Start general and get very specific. Do not start coding until you know precisely what you want the end result to be and you have that defined. Also realize halfway through your project you''ll think of something you want to add. Unless it''s absolutely CRUCIAL, jot the idea down and details, then when you have your base project done, go and add that. How far you break things down into OO is up to you. If it makes sense to add a class for keeping track of whose turn it is, do that. My own personal recommendation would be to have a "game" class (I normally call mine CGame) and then have a linked list of connected player classes (local, AI, or network). Just definately be sure of what it is you are trying to produce before you write many lines of code or you''ll find yourself doing a lot of rewriting.

Share this post


Link to post
Share on other sites
Learn UML - the Unified Modelling Language :-)

There are nice tools out for it - Visio 2002 can do it, and Rational can do it, but the later one is "professional" in its pricing (means. even a MSDN Universal subscription is CHEAP compated to this tool).

There was a nice PDF about UML once on the Rational website, which was great as a learning starter.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
quote:
Original post by Russell
Is my problem in understanding software design?

Not really. The problem is that software is innately complex, with many different ways to solve the same problem. It''s rarely obvious what the "right" way to solve any particular problem is, and that seems to be what''s causing your problem. Rather than spending much effort figuring out the perfect design, it''s a good idea to learn how to write s/w so it is easy to *refactor*, meaning there is very little effort required in evolving the design to meet new needs as they emerge. I recommend you beg, borrow or steal a copy of Refactoring by Martin Fowler.

Share this post


Link to post
Share on other sites
Well I picked up a copy of Refactoring at the book store. I must say you seem to be right on the money. I''ve only read a little, but it looks like it''s going to be a very good book. Thanks!

Russell

Share this post


Link to post
Share on other sites
Refactoring is really expensive, methinks. Is it really worth the pricetag?


"We should always be disposed to believe that that which appears white is really black, if the hierarchy of the Church so decides."

Ignatius Loyola, founder of the Jesuits

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
Refactoring is really expensive, methinks.

You mean the book or the technique?
quote:

Is it really worth the pricetag?

It''s £24.79 on Amazon.co.uk. Yes, I do consider it worth the pricetag.

Share this post


Link to post
Share on other sites
I meant the book Its a bit more expensive in the stores here though, ~500 NOK(->£45?) I believe.

/me runs out and buys it.


"PL/I and Ada started out with all the bloat, were very daunting languages, and got bad reputations (deservedly). C++ has shown that if you slowly bloat up a language over a period of years, people don't seem to mind as much."

James Hague


[edited by - Arild Fines on August 27, 2002 8:23:02 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
I meant the book Its a bit more expensive in the stores here though, ~500 NOK(->£45?) I believe.

Ouch! Amazon.co.uk will deliver to Norway for about £4.

Share this post


Link to post
Share on other sites
I paid about $50 (US) for mine, just because I didn''t want to have to wait a week for it to be delivered. I haven''t even read much of it and I think it''s worth it already

Russell

Share this post


Link to post
Share on other sites