[Bluej-discuss] confusion over =
Michael E. Caspersen
mec at daimi.au.dk
Thu Nov 29 22:00:30 GMT 2007
Dijkstra pronounced the assignment operator "becomes", i.e.
a= b+c;
reads "a becomes b+c". I like that; it's simple and clear!
BTW, notice the asymetrical notation; since = is an asymmetrical
operator, it should be written as such. This helps parsing the
statement; it also reinforce that = is not the equality operator.
In a similar way, again due to Dijkstra, I tend to put extra space
around low priority operators -- again to help the eye (or what's
behind it) to parse the expression. E.g.
a + b*c
It took mankind more than 150 years to agree upon = as the sign for
equality (it was only much later that it was concieved as a boolean
operator). Kernighan & Ritchie did a lot of harm when they
"designed" the syntax of C.
Best regards,
Michael
More information about the bluej-discuss
mailing list