Alpha Sensitive

lettersMany offices feature “casual Friday” in acknowledgement that today our attention begins to shift towards the weekend. (When I started with TC in 1980, ties were required. When I retired this year, “business casual” was the norm. I worn jeans and polo shirts the last half-dozen years or so.)

In the same way, today the focus here shifts from the tough and chewy Sideband material to something softer and easier to digest. I have what amounts to a bit of a rant, but a mild-mannered one of minor import. It’s just one of those little things that’s annoyed me in a small way for a long time. (But it turns out that it’s one of those things that actually have good reason!)

It’S aBoUt ThIs ThInG cAlLeD cAsE-sEnSiTiViTy!

The idea that letters come in two forms, an “upper case” form and a “lower case” form goes back a long way, nearly as long as the idea of letters themselves. (But not all the way back. Originally, letters were all capital letters, what we now consider upper case.)

typecases

Just in case…

The terminology, “upper case” and “lower case,” is more recent and comes from the early days of typesetting. [Read more on Wikipedia.]

To be very clear, I am not in any way opposed to bicameral letters; I quite favor having two cases, in fact. (But I’m not prideful, of course. I am always mindful and respectful that not all languages have two cases. And some have, like, a bazillion characters in their alphabet, which makes English look pretty puny.)

I have Very Fond memories of A. A. Milne‘s distinctive use of case to signify Important Things! It’s a style I enjoy imitating at times. If you ever see me capitalizing for emphasis, that’s Milne’s Influence!

in high school, as many creative types do, i flirted briefly with poetry written entirely in lower case, just like e.  e. cummings.  i eventually realized that, unless you actually were e.e. cummings, imitating him was either pretentious or silly (depending on the size of the chip on your shoulder; i usually carried a log).

Pooh Corner

This, without doubt, is one of the best books in the entire history of the world!

Given the topic at hand, it’s a cute coincidence how “A. A.” and “e. e.” covers a range of creative use of letter case!  (What it’s not is “ironic,” but I don’t have the twitch about the misuse of that word that some do. I do find the abuse of “literally” (literally) mildly annoying, but it’s the complete disregard of “your” and “you’re” that really grates. As they say, it’s the difference between knowing your shit and knowing you’re shit.)

So, in the use of written language, I think case is great. I love it and have fully adopted to its ways. I encourage all my friends to do the same (but I don’t get religious about it; if you have other beliefs, I’m okay with that; it’s even possible my bias for it is due to childhood indoctrination).

Where it does bemuse me sometimes is in computer languages.

To understand why, we need to step into Wayback Machine. We also need to have a mildly technical look at how computers store numbers. Since today is Finally Fried-Egg, it’ll be as casual as possible; dress accordingly.

matrix code

No, not like this. This was from a movie. Funny story: had a Matrix screen saver. Guy at work asked if it part of my programming work.

Computers represent letters as numbers. The amount of different letters they want to be able represent controls the size of those numbers. To represent “A” through “Z” you only need 26 different numbers. That’s the same as saying you only need to count up to 26; that’s your biggest number.  If you want to include “a” through “z” and, say, punctuation symbols, then you need to count higher.

The upshot is that, every place in the computer you might store a letter (and there are many billions of them in your RAM and on your discs) needs to be able to hold a number as large as necessary for representing letters. That’s your limiting factor.

Computers these days deal with very large numbers, so the limits are history now, but in the very early days, space was precious; the numbers had to be small.

Take it back to the early days of representing letters as numbers: the telegraph. Morse Code (which goes back to roughly 1840!) only has codes for one letter case. The telegraph, and hence telegrams, were ALL UPPER CASE STOP TODAY WE SEE THAT AS YELLING STOP SOME OF US OLD HANDS CANT RESIST SUGGESTING THAT THEY STOP STOP

telegraph

Only a mere 162 years until the iPod shows up!

The poverty of letter representation continued into the earliest days of computing. The computers themselves usually were capable of case. Both ASCII and EBCDIC (very early code schemes for representing letters, numbers and punctuation) had upper and lower case codes. The problem was the input and output devices; perhaps the output devices more than the input ones — keyboards have featured both cases a long time.

Yet some very early computer keyboards lacked any case-shifting key, and printers were especially crude. (Show of hands: who remembers the annoying back and forth whine of the dot matrix printer?) Sending the data from point to point was also a limiting factor. One very early scheme (going back to when you stuck your phone handset in these two rubber cups) Baudot only had a single letter case (like Morse Code, but more modern: Baudot comes from 1874).

Jump forward over one-hundred years from the telegraph. The computer languages from the early days (Fortran, COBOL, ALGOL, PL/1, BASIC, etc) were also unicase. Even if you had a keyboard capable of both cases, the language ignored it.

Teletype

After these slow noisy beasts, the dot matrix printers seemed like a dream! (I will say that typing on one of these did make for very strong fingers!)

Which brings me to my point.

Today’s computer languages, pretty much without exception, feature what amounts to a 52-character alphabet. In most modern programming languages, “Wyrd” and “wyrd” (and “WYRD”) are separate names. Imagine living in a world in which Wyrd and wyrd are two distinct people!

If that seems nutty, well, it is a little nutty, and yet it’s the way most computer languages today are. For example: Java, C#, Python, JavaScript, Perl, C++, C, all are case-sensitive. In all those worlds, “Wyrd” and “wyrd” are distinct individuals!

That might be considered an unfair list given that all but one of those languages are in what’s called “the C Family” of languages. All have those {curly braces}, for example, and all share in being case-sensitive. As unfair as it might be, those languages cover a lot of the code being written today. Some of the more common non-C family languages that are case-sensitive include Smalltalk, Tcl and some forms of Lisp and Scheme.

A few languages take case extra seriously. In OCaml and Haskell, the first letter must be lower case, but in Prolog it must be upper case! Ruby considers variables with an upper case first letter to be constants. (Little differences like this really keep a cross-trained programmer on their toes!)

VB

I’ve used VB for some pretty large, complex applications!

Microsoft’s little gem, Visual BASIC, is not case-sensitive, and since VB has become the automation language of Microsoft products (and of other vendors!), that covers a fair bit of ground. I confess I’m a big fan of the language and used it heavily for years, both personally and at work. To this day I use tools I made for myself in VB!

Of course, Visual BASIC harks back to its ancient namesake, BASIC, which wasn’t case-sensitive. Neither was the other language intended as a teaching language: Pascal.

For that matter, the DOD‘s preferred language, Ada, is not case-sensitive, so there is at least one current major production language where “wyrd” and “Wyrd” (and “WYRD”) are all one. Ada belongs to the ALGOL family (as does Pascal), so lack of case-sensitivity isn’t surprising here, either.

Certainly case-insensitivity is historically rooted, and certainly modern computers are well able to handle case these days. But it would seem strange (at first blush) that only in the weird world of computer programming is case-sensitivity an issue. Is it not true that mail addressed to “Santa” or “santa” or “SANTA” (or “SaNtA”) is all delivered to the same Jolly Fellow? Is it not the (pardon the expression) case that in the real world case just doesn’t matter?

Yes. That is: it is not the case that case doesn’t matter in the real world.

Reading

“So, what have you been reading in Reading?”

Consider that, if you lived in south-east Pennsylvania, there is a world of difference between the phrases, “I like Reading,” and “I like reading.”  Of course, if you say that to someone — unless they can Hear the Capitals in your Voice — they’re going to have to ask, “Do you mean books or the city?”

We do have rules about capitalization in English, and we do consider people who break those rules to be less than fully capable writers. Unless they’re A. A. Milne or e. e. cummings.

There is a stronger reason case sensitivity is a Good Thing. The original limitation was not due so much to the inability to store, transport, or display, letters as it was the difficulty of actually treating “A” and “a” as the same code. Because they aren’t in the computer.

swirly

Ultra, super-swirly case!

The process of treating “ABCED…” the same as “abced…” is called folding case, and while it’s really easy to do with the 26 English letters, when you consider other languages the task becomes a nightmare. In some languages, certain characters may only appear in one case, so there’s no possible conversion. I’ve read one report of a 300% increase in processing time once the need to fold Unicode text was removed. Most of the time was spent in the toLower() function!

It may have begun as a practical limit, but today computer language case-sensitivity is more due to it being a global world than anything else. It may raise its own kind of programming bugs, but pretty much everything you do does. Love it or hate it, at least now you understand it!

About Wyrd Smythe

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts. View all posts by Wyrd Smythe

Comments are disabled.

%d bloggers like this: