Re: Languages

From: Christian Loth (sg618lo@unidui.uni-duisburg.de)
Date: 03/11/99


Greetings,

Am Don, 11 Mär 1999 schrieb Daniel A. Koepke:
> Christian Loth wrote:
> >
> > Yes, but as far as I understood George's initial criticism that
> > this is exactly what he criticized...you need to open a new block
> > {} for that.
>
> Not to rub it in -- but regardless of George's initial criticism the

No problem, valid criticism where valid criticism is due ;)

> information, or at least the example, you gave was incorrect.  The
> overhead concerns are moot.  You said something along the lines that

However I strongly disagree with the mootness of performance
considerations. Take the following example, which could be
implemented for a MUD (it's based on a RL program, however
not MUD based, but a CGI program for a webboard by me).
Imagine you'd like to implement boards with threaded messages.
Now, the messages of that board are objects of class 'message'.
In the c'tor the object checks, whether it is the first of a thread,
and therefore it 'spawns' it's children in the c'tor and adds them
to a list. I.e. in the c'tor another c'tor is called, and maybe more,
depending on replies to the initial message and whether more
threads spawn from the initial thread...
That means this construction sure is a performance issue and I
only want it to occurr when I actually need it. Ok, granted, it's
only needed once at startup, so even this example might not be valid...
...but it shows that there might arise situations where 'placement of
construction' can be important.

[ some very valid criticism to previous posts snipped and agreed to ]

> I consider the placement of variables in a non-uniform place highly
> unreadable.  The claim that having the variable declared right before

Yes, I also strongly dislike an int here, a float there, and the
'oh-I-could-use-a-bool'-bool. I also consider 'random'
placement of these variables bad style and bad for readability.
But there are valid reasons for placing a variable at a place
where it needs to be. Also, it can prevent the 'pollution' of
namespaces (or scopes).

> you use it helps you find it has never made sense to me.  Variables
> sandwiched between code have always been harder to find for me.
>
> I'm also a fan of allowing variable declarations as the left-most
> parameter to for(), since iterators shouldn't always have to live
> outside the scope of the loop.  I think this is the only situation
> where, "place the variable right where it first comes into use," is
> acceptable and contributes to readability.  But that's my opinion.

...which has valid points in my opinion.

- Chris

--
Christian Loth
Coder of 'Project Gidayu'
Computer Science Student, University of Dortmund
sg618lo@uni-duisburg.de - chloth00@marvin.cs.uni-dortmund.de


     +------------------------------------------------------------+
     | 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 : 12/15/00 PST