Forum 2005-2010 (read only)
Syntax & Programs
Topic: !! Symbol
(Read 3291 times)
Re: !! Symbol
Nov 29, 2010, 07:54 am
: Nov 29, 2010, 07:55 am by pekka
In other words:
Arduino is -- or I got the impression while starting with Arduino -- aimed at those who are not familiar with embedded devices or programming.
If this is true the learning curve should be made as easy as possible.
Being inquisitive leads to beginner reading and hopefully understanding what others have done, like the beginner of this thread has done (and no, I'm not saying he was also a novice) -- he found odd notation (or whatever, if that is the wrong expression) of double exclamation point and had to ask for help. If the double exclamation point would have been easily found from within the reference, this thread and discussion would have been unneccesary.
My sugestion is to add a "Hint" section to topics at reference and on
give a hint that double exclamation point is used to convert values into boolean. This is perhaps everyday routine to you advanced ethusiasts and cleary understood by consulting the refeence, but not to all beginners.
As subheadings of page:
are not links to anywhere I would have liked to see under "Conversion" one extra row under this heading:
!! (to boolean)
and as the !! exclamation point is not a single operator, it should be somehow "demoted".
As on page http://arduino.cc/en/Reference/Boolean there is an explanation of operators whose symbols are related to chars '&', '|' and '!', and as the connection between '&' vs. '&&' and '|' vs '||' is made clear, A novice like I may easily jump into false concluson that there is a similar connection between '!' vs. '!!' (which there is not, as I now know).
I think that a simple note of this non-connection and the meaning of '!!' added on boolean page would perhaps make thigs a bit clearer to us novices.