discussion Digest, Vol 45, Issue 18

Hans Bezemer thebeez at xs4all.nl
Fri Oct 25 13:04:33 EDT 2013


On Friday 25 October 2013, discussion-request at lists.en.qi-hardware.com wrote:
> Actually, Werner wrote quite a bit about how the parenthesis can hide
> errors (or worse, malicious code).
>
> > It is also a sign that the programmer has no intention to use my
> > ignorance in order to install a backdoor.
>
> So this seems a direct contradiction. ;-)  The code he quoted actually
> was an attempt at doing just that, and it only worked because of the
> parentheses.
IMHO it's not the parenthesis, but the == operator. Using = instead of e.g. := 
is just too easily overlooked, since comparison using = is SO NATURAL. It's 
just like != is not as easy to understand as <>.  It simply doesn't "catch 
your eye".

Therefore, when I started C, I used things like EQ, LT, GT instead (long live 
the preprocessor). Added to that is the problem that a comparison is not 
obligatory in C.

Finally, C's strength is also it's weakness. It's cool you can "chain" a 
million instructions into one statement, but this is one of the consequences. 
Pascal enforces more structure, but can be tedious (and boring) in some 
aspects.

In short: I concur where the problems are concerned, but I don't think 
eliminating parenthesis is the solution. It's far more fundamental.

I remember Ritchie saying: "yes, I made errors when designing Unix. I should 
have named "umount" "unmount"". I think = and == fall into the same 
category. ;-)

Hans Bezemer


-- 
I have no Facebook account. Consequently, I have no friends and I don't like 
anything. Deal with it.

Visit our website! http://thebeez.home.xs4all.nl/4tH/

*** Home of the 4tH compiler! ***



More information about the discussion mailing list


interactive