game coding no-no's (spin off from thread "goto")

game coding no-no's (spin off from thread "goto")

Post by Alle » Mon, 04 Aug 2003 02:31:00

Hi all,

Of course, this will probably end up much the same as the goto thread,
but I'm still interested in hearing what other's opinions are.

In addition to the "goto" taboo, I've heard of other "game coding
no-no's". Unwinding loops, inline vs. calling, instruction re-ordering,
Specifically, I'm curious about the function call issue. I've read that
function calls can really slow down execution speed (something about having
to transfer exec control, dump the registers, or something like that).
Obviously, you have to have some but I've read that you should avoid
excessive calling when possible.

What are some of the biggest general "no-no's"? Do they make a
difference in the functionality or are they more "sound design principles"?
Best wishes,

No SPAM in my email !!

game coding no-no's (spin off from thread "goto")

Post by Alle » Mon, 04 Aug 2003 04:51:19

Hi Tom,

Sarcasm parsed; point taken. :-)

I guess the fear for someone like me (non-professional, no programming
classes) is that you learn the language and start using the structures it
provides. Then all of a sudden, you read somewhere that you shouldn't do
this thing or that thing and that begins to hint at an entire layer beneath
the one you thought you understood. "Oh no! Everything I've written is
wrong and I'm not even sure why!"
Best wishes,

No SPAM in my email !!


game coding no-no's (spin off from thread "goto")

Post by Rainer Dey » Mon, 04 Aug 2003 10:57:09

I'm generally more interested in making it robust and maintainable than in
making it fast. The rule still applies - make it work, then make it
pretty - but at a much finer level of granularity. Implement a feature,
then clean it up, factor out common functionality, make sure it behaves
correctly in exceptional conditions, and so on. Then implement the next
feature. The longer you wait before refactoring, the harder it gets.

Rainer Deyke - XXXX@XXXXX.COM -

game coding no-no's (spin off from thread "goto")

Post by gerry » Mon, 04 Aug 2003 18:45:31

Depends what you're doing. If you're going straight into a 3D
Doom-a-like, you don't need the bulk of the Windows API. If you do want
to use the OS features, however, MFC seems the most effective C++

It may not be the most wonderful library in the world, but when you get
the hang of it it's okay.

Gerry Quinn
Screensavers and Games for Windows
Download free trial versions
New screensaver: "Hypercurve"

game coding no-no's (spin off from thread "goto")

Post by Eternal Vi » Mon, 11 Aug 2003 13:54:15

guilty -- but if they arent legible to other humans??

guilty -- but then its my code and I can do what I want

guilty -- but real sin is for loop iterator with more than one

ever since Mr Borlands compiler its not a biggee (when else can you go
for coffee/whatever)

I prefer my mutant rabbit brain processor (wetware) -- coding with
cattle prod IS much more fun....

A smart optomizer (or programmer of that optimizer) can do wonders.
Maybe the run-of-the-mill MicroShoddy compiler aint what it ought to