[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Game announcements on LGDC



> 
> As for long function names, that's a sort of COBOL mentality, that code
> should be "just as easy to read as ordinary text", and adding lots of
> verbosity is a means to this end. A seasoned COBOL programmer, for
> instance, would suggest that I replace the variable STARTX with
> STARTING-X-POSITION-OF-SPRITE. Ack. 

This also depends on where the variable is - is it a global variable? Then I
would recommend the longest & most descriptive name possible. Is it in
a helper 10-line static function? Who cares then?

> read from a clutter standpoint. Parsing entire phrases isn't something I
> want to do when I'm looking at the name of a function or variable.
> Hence, my functions tend to be concise: MoveSprite, ChangeSpriteShape,
> SetSpriteMotion, etc. :)
> 

In this particular case, I'd prefer sprite_move, sprite_change_shape,
sprite_set_motion, all placed in "sprite.*". Nuff said...:)

> 
> Hey, their code might do something cool, even if their style is poor.
> For example, there is a relativistic raytracer out there that's coded as
> one big .CPP file greater than 300K in size. I don't think we should bar
> the announcement of something interesting or useful if someone feels the
> author didn't comment it properly (this is kinda one of my sins :)) or
> the function names aren't descriptive enough. 
> 

I propose something like the happypenguin.org ratings with 0..5 stars :-))) or
just a Warning that it's very _hard_ to read the code.



Tomas Andrle -- tomaasz@iol.cz