Less commas

spir denis.spir at gmail.com
Sun Jan 2 14:30:21 PST 2011


On Sun, 02 Jan 2011 20:56:48 +0000
Peter Alexander <peter.alexander.au at gmail.com> wrote:

> > This is great stuff, bearophile. Thanks for finding that. Please add
> > this as an enhancement request to bugzilla (disallowing (!x&y)
> > expressions).  
> 
> That really surprises me that it's a common bug. Isn't it obvious that ! 
> has higher precedence than &? Or have I totally misunderstood the cause 
> of the bug?

That's not such surprising: a study on the topic (operator priority) has shown a very high frequency of such errors (in C). The public were all highly educated, tranined, experienced, programmers. 
On the other hand, the same study showed how ridiculous the proportion of lines of code holding poly-operator expressions is (which comparatively still highers the relative frequency of errors).
A logical conclusions is , I guess: is it worth complexifying a language (by a sub-language just for expressions, which is often the bigger and most complicated part of a parser) & causing loads of bugs for a need that arises even 1000th lines of code?

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d mailing list