English considered badly designed [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Fri 2007-06-15 14:01
English considered badly designed

Something that came up in conversation the other day: the English language is annoyingly badly designed for programmers.

The most obvious example of this is that almost any pair of words you can think of to represent boolean values have different numbers of letters, so that it's inconvenient to line them up in tabular layouts in a fixed-width font. TRUE/FALSE, YES/NO, ON/OFF. All of them out by one. Even if you look further afield to things like YEP/NOPE and YEAH/NAH, you don't find a matching pair. AYE/NAY works, but it's a bit specialist in its connotations (it suggests there's a vote taking place) as well as archaic. This is just useless. French can find OUI/NON with no difficulty at all (although I have no idea whether French programmers actually use those for booleans), so why can't we manage one pair of suitable words that are the same length?

(Some years ago, [livejournal.com profile] lark_ascending and I gave some thought to this, and the best we could come up with was VERILY/NOWISE, which is even more archaic than AYE/NAY. However, it does have the advantage of allowing MAYHAP to be inserted in the middle if the application demands it.)

Another annoying thing is that one of ‘width’ and ‘height’ shares an initial letter with one of ‘horizontal’ and ‘vertical’ – and it's the wrong one. So if you're looking through some code which has dimensions in it, and you encounter a variable called h, you can't be sure which dimension it contains until you find out whether it's accompanied by v or by w. I suppose we can at least count ourselves lucky that ‘width’ isn't spelled ‘vidth’, in which case we'd be even worse off.

It feels particularly unfair because these sort of accidents of language happen to work better in less programming-specific contexts. For example, the fact that ‘his’ and ‘her’ both begin with the same letter is very convenient for acronyms such as HMRC and HMG.

Also annoying is that I've been planning to post this rant for months, and have been delaying because I had a strong feeling that there were several other examples which I couldn't quite bring to mind. But they still haven't come to me, so I'm just going to have to post it like this and kick myself when I realise what they were moments afterwards…

LinkReply
[identity profile] valkyriekaren.livejournal.comFri 2007-06-15 13:06
RIGHT/WRONG
REVERSE/OBVERSE
Link Reply to this
[personal profile] gerald_duckFri 2007-06-15 13:07
YUP / NAH
YA RLY / NO WAI
Link Reply to this | Thread
[identity profile] valkyriekaren.livejournal.comFri 2007-06-15 13:09
*SNORK*
Link Reply to this | Parent
[identity profile] valkyriekaren.livejournal.comFri 2007-06-15 13:08
Those cheeky Frenchies also have VRAI/FAUX, and DROITE/GAUCHE, of course.
Link Reply to this | Thread
[personal profile] gerald_duckFri 2007-06-15 13:18
Problem is, both sets agree with the noun. If you were talking about something masculine it would be DROIT/GAUCHE, which doesn't work so well. If something masculine plural, VRAIS/FAUX breaks.
Link Reply to this | Parent | Thread
[identity profile] valkyriekaren.livejournal.comFri 2007-06-15 13:35
True - though if you're using it in a programming context, I'm not sure how much it matters - it's a statement rather than in a sentence: (c'est) vrai or (c'est) faux.
Link Reply to this | Parent | Thread
[personal profile] gerald_duckFri 2007-06-15 13:41
It becomes inconveniently important whether you're testing le résultat d'une fonction or la valeur d'une expression
Link Reply to this | Parent
[identity profile] valkyriekaren.livejournal.comFri 2007-06-15 13:15
Oh, and HEADS/TAILS
Link Reply to this | Thread
[personal profile] simontFri 2007-06-15 13:19
Mmm. The trouble with that and with REVERSE/OBVERSE is that it isn't immediately clear which one is positive and which negative. Same with DROITE/GAUCHE, come to think of it.

(Hmm, although POSITIVE and NEGATIVE do qualify on that basis. Bit long, though, unfortunately.)

RIGHT/WRONG is quite nice, though, and surprisingly semantically close to the usual choice in practice of TRUE/FALSE. I wonder why nobody uses it. I suppose there's a bit of a connotation shift: FALSE means you've just made a statement (for whatever reason) that isn't true, whereas WRONG means you genuinely thought it was true and are actually probably-culpably mistaken. Hmm.
Link Reply to this | Parent | Thread
[identity profile] valkyriekaren.livejournal.comFri 2007-06-15 13:36
True - they're diametrically opposed but not necessarily boolean.
Link Reply to this | Parent
[identity profile] mooism.livejournal.comFri 2007-06-15 13:19
You *want* true/false to be different lengths -- this means if you already know that it's true or false, you can tell which one it is just be seeing how long it is -- doesn't require going to all the trouble of *reading* the word, doable with peripheral vision.
Link Reply to this
[identity profile] uisgebeatha.livejournal.comFri 2007-06-15 13:29
I believe ThinkGeek has a YO!/'SUP T-shirt as an alternative for SYN/ACK, which I quite liked... :)

(Do you know [livejournal.com profile] naranek well btw? Just wondering if you'll be at the BBQ on Sunday :))
Link Reply to this | Thread
[personal profile] simontFri 2007-06-15 13:38
I've been to a Kendal Way barbecue before, I think, but I'm usually busy for most of Sunday afternoon. I could pop along for an hour or so at the start, perhaps, if I've managed to get out of the bath by then :-)
Link Reply to this | Parent
[identity profile] feanelwa.livejournal.comFri 2007-06-15 14:21
It's on Sunday? *goes and checks* so it is! I nearly went on Saturday. That was lucky, thank you!
Link Reply to this | Parent
[personal profile] gerald_duckFri 2007-06-15 13:30
Anyway, why not just use 0 and 1?

If you absolutely insist, '/'/'/' and '-'-'-' to disginguish from the use as numbers? (-8

Link Reply to this
[identity profile] ewx.livejournal.comFri 2007-06-15 13:47
Taking a leaf from Hot Fuzz: YARP/NARP.
Link Reply to this
[personal profile] deborah_cFri 2007-06-15 14:05
So, what were the other examples? Or does this comment recursively invoke not remembering them when required? :-)
Link Reply to this
[identity profile] feanelwa.livejournal.comFri 2007-06-15 14:22
The person who wrote our tomography code evidently also got annoyed about this because he writes Y/N wherever possible.
Link Reply to this
[identity profile] dennyd.livejournal.comFri 2007-06-15 14:45
ROCKS / SUCKS

:)

(see also Inverse binary rock/suck entanglement (http://london.pm.org/pipermail/london.pm/Week-of-Mon-20060807/003585.html))
Link Reply to this
[personal profile] fanfFri 2007-06-15 15:35
OK / NO
POS / NEG
Link Reply to this
[identity profile] cartesiandaemon.livejournal.comFri 2007-06-15 15:36
That's a good point, it's always annoyed me, but I've never really thought about it from a fundamental point of view.

ROFL. I love VERILY/NOWISE.

You could do YYY/NNN I suppose, it's clear.

Come to think of it, there's room for convention here. Eg. your editor could space out true to be 5 chars wide. You can have warnings if you use w/h together in dimensional analytically unlikely ways.[1]

[1] Random thought -- if you're exposing yourself to dymanic typing (or constrain the initialisation value's units not to change) who says the variable needs to be it, where are the "int width = 3 pixels;"? :)
Link Reply to this
[identity profile] pseudomonas.livejournal.comFri 2007-06-15 21:28
The width/height thing reminds me of the mother/father-male/female version, which is occasionally annoying.
Link Reply to this | Thread
[personal profile] pthaloMon 2007-06-18 13:34
On Hungarian passports, gender is listed as either F or N, which expands to Férfi (man) or Nő (woman). It always takes me a while to remember what language I'm supposed to be thinking in when I see either an English female's passport (sex: F), or a Hungarian male's passport (sex: F)
Link Reply to this | Parent | Thread
[personal profile] simontMon 2007-06-18 14:15
And that in turn is reminding me of the confusion on taps between the UK and France: H(ot)/C(old) versus C(haud)/F(roid). ISTR being tripped up by this a couple of times when I was a small child on French exchanges, absentmindedly turning on the C tap and finding it was unexpectedly hot.

As I recall, I eventually solved this problem not by learning to think in French, but by pretending the French had higher standards for hot water, so that our "hot" and "cold" were by their standards "cold" and "freezing" :-)
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]