Re: style

From: George Greer (greerga@circlemud.org)
Date: 03/26/00


On Sun, 26 Mar 2000, Edward J Glamkowski wrote:

>1.  Initializations of pointers being removed. In many cases, pointers,
>when declared, were immediately set to null, or zero, e.g.: struct
>obj_data *foo = 0; The patch is removing these intializations. This, to
>me, is a Bad Thing (tm).  In fact, not only should they not be removed,
>but everywhere else there isn't such an init. during declaration, it
>needs to be added! It's just safer that way (and easier to debug later).

If you mean:

act.comm.c, 'paper' is unconditionally initialized later.
act.informative.c: 'obj' is also.

I could keep going but you get the idea.  If we don't initalize it, think
of it as a guarantee that we won't just spontaneously use the variable.
It'll have something assigned to it (later) that is used.

>2.  Return statements at the end of void functions are being removed.
>While it is true they are technically not necessary, they make for more
>consistency (every other function that returns something has a return
>statement, and if you want to return in the middle of a void function you
>need a return statment) and readability (a closing brace at column 0 is
>not always guarenteed to be an end of function marker - some people are
>extremely sloppy in formatting their code, I've seen it on quite a few
>patches and snippets for Circle MUD, not to mention elsewhere).  I say
>ALL void functions should have a return statement at the end, and this
>nonsense of removing them needs to be stopped and reversed.

We're consistent, therefore they're useless.  Your code may become
unconsistant, but then you should fix the code, not add extra 'return;'
lines that may be at the wrong indent level anyway.

--
George Greer            | Sammy's Code - OBuild
greerga@circlemud.org   | http://users.ticnet.com/samedi/code.html


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT