[Tutor] OOP class declaration question

Magnus Lycka magnus@thinkware.se
Thu Jan 9 21:17:01 2003


At 17:08 2003-01-09 -0600, Cameron Stoner wrote:
>What I really wanted to do is create classes that had high reusability for 
>a game idea of mine.  I also wanted to use them for future game additions 
>possibly so I wanted to be able to use them with future ideas in mind 
>already.  I know you can just modify the code, but it was an idea I got 
>from the way Microsoft designed the DirectX stuff.  There are loads of 
>attributes that you don't necessarily use, but they have defaults.  I'm 
>kinda using Python to test ideas for classes later to be built in C++.

Whether you implement in Python or in C++, I would claim
that this approach is in general a bad idea. It's good to
think ahead to some extent, but try to keep your code as
simple as possible. Otherwise you will get a large burden
of maintenance for a lot of things that you are likely to
never need.

None of us are godlike enough to predict what we will need
in the future. Typically it's not what we thought. One of
the great things with programming and software development
is that we learn new things all the time. A natural
consequence of that is that it's often best to scrap old
ideas. If we still can... The more we have "prepared for
the future" by adding features that we don't need yet, the
harder it will be to change approach--both technically,
psycologically and economically.

See www.c2.com/cgi/wiki?YouArentGonnaNeedIt and
www.c2.com/cgi/wiki?DoTheSimplestThingThatCouldPossiblyWork



-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se