[DGD]1.1.52

Stephen Schmidt schmidsj at union.edu
Sun Mar 14 02:34:15 CET 1999


On Sat, 13 Mar 1999, Mikael Lind wrote:
> For instance, a construction such as
> 
>     if (string_value) {
>         print(string_value + "\n");
>     }
> 
> is logically hairy but practically useful. I use it all of the time. But I
> don't like it. There is of course the elegant alternative
> 
>     if (string_value != nil) {
>         print(string_value + "\n");
>     }
 
> I could use this, but I don't want to. Since the interpretations of 
> the tests are identical, I prefer the shorter form. This is something that
> may or may not make sense to you. 
 
I prefer the scond, more elegant alternative. I'm always willing
to add seven additional characters to my code for a gain in
clarity/elegance. I add thousands of characters in comments for
the same reason, so what harm does seven more do?

The other important reason (to me anyway) is that when this stuff
works it into the game world, it ends up in the hands of people
with limited programming skills and zero formal background in
CS. For that reason, I try very hard to eschew the more esoteric
programming constructs (the ++ operator is another one) which
present only minimal gain in terms of CPU/disk/screen use, and
may be difficult for a newbie to pick up on. I use such
constructs more than I used to, which may be good or bad,
but I still try to hold it down.

> I also think
> that a certain amount of strictness in a programming language such as LPC
> is solely positive. Unfortunately, I feel like I'm having a hard time
> formulating my thoughts on the subject. Can anyone tell me what I'm trying
> to say? 
 
Dunno if this is what you're trying to say or not, but the more
strictness you have in the language, the easier it is for newbies
to get compile-time errors (which are easier for them to fix)
rather than runtime errors (which are far harder for them to fix).
In my experience, anyway. YMMV.


Stephen Schmidt

It is vain to expect a well-balanced government without a
well-balanced society.
			-- Gideon Welles



List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list