Why is there no or or and ?
Marco.Leise at gmx.de
Fri Feb 17 09:30:09 PST 2012
Am 17.02.2012, 16:08 Uhr, schrieb Nick Sabalausky <a at a.a>:
> I've always agreed with the usual reasoning behind ":= and = instead of =
> and ==", but in practice I don't like it becase assignment is so
> *incredibly* common I don't want it to be a 2-handed 3-keypress
> "Shift+Keypress and then another keypress". Just one keypress, thank you.
> And yes, equality is fairly common, too, but *UNLIKE MATH*, equality isn't
> quite *as* common as assignment. Plus, "==" is even a little easier than
> "two keypresses" since it's the same key, not two different keys.
Why didn't I think of that before! The perceived ease of use depends - in parts - on the spoken language you use, because different keyboard layouts are used. To pick up your example, I don't mind := because I have to hold [shift] already for a normal =. I just compared the default US and DE layouts. Here are some characters that can be achieved with one key stroke in either layout exclusively:
So while the US layout lacks XOR and even + (wow), I'm a bit jealous on =, array operations , end of statement ;, division /, character delimiter ', and raw string delimiter `.
Then I remembered what happened when I enabled Pascal as a language for aichallenge.org: http://aichallenge.org/language_profile.php?language=Pascal
A flood of users from countries with a Cyrillic keyboard layout joined the competition using Pascal. Back then I thought it was just a random prevalence of Pascal for reasons like, that being the language taught in schools. Now I wonder if - aside from what is taught at schools and aside the fact that they mostly use English layouts to write code - it is the lack of keys for | and & on a typical keyboard that makes Pascal look more appealing: http://en.wikipedia.org/wiki/Keyboard_layout#Cyrillic That's just a wild theory.
I might look into tuning a keyboard layout towards D programming a bit. :)
More information about the Digitalmars-d