Saturday, May 08, 2010

I think German should be written in camelCase

I'm sure I'm not the first person to suggest this. ;^)

Everyone who's a programmer knows what camelCase is. That's when you use capitals in the names of variables or functions to make them more readable. For example: setLength() or startsWith().

You can probably see where I'm going with this in German.

Consider a simple number like 19,764. In German, it's neunzehntausendsiebenhundertvierundsechzig. Now, wouldn't it be more readable as neunZehnTausendSiebenHundertVierUndSechzig?

They already capitalize all of the nouns anyway, so why not go one step further? For example: "der Waschmaschinenschlauch" => "der WaschMaschinenSchlauch". Better, no?

It would also help with those crazy separable verbs. If you haven't studied German, you may not know that there's a whole class of verbs with prefixes that are sometimes attached, and sometimes find themselves on opposite ends of the sentence...

Take "zumachen" (for closing something like a window). You can say "Ich will das Fenster zumachen" or "Ich mache das Fenster zu." In my fantasy universe, it would be written "zuMachen".

Anyway, if any of you have access to the person who's in charge of German spelling/grammar rules, please be sure and suggest it. ;^)

12 comments:

Ren said...

I didn't know that was called camelCase. I do that a lot on Twitter for long #hashTags :)

C. L. Hanson said...

Hey Ren!!!

Cute name, isn't it? It comes from the fact that you make humps in the middle of a word, like a camel's back.

It clearly has a lot of uses in the computer world, so maybe this use for German will actually catch on in the Internet! :D

raytheist said...

I do that for naming files on my computer rather than leaving spaces.

TGD said...

I adopted that method when I started programming professionally in the early 90's. I've gone as far as making some function identifiers complete sentences.

Easily readable, self-documenting code for the win!

Holly said...

I approve of anything that makes German easier to learn. I found it about as frustrating as Chinese.

C. L. Hanson said...

Hey raytheist and TGD!!!

It's true -- it's amazingly useful for so many applications (and I love self-documenting code)!

Hey Holly!!!

I know what you mean. As much fun as I'm having with this, the rules of German grammar drive me completely nuts!

The problem is that there is a very small number of possible endings for nouns, articles, and adjectives (r, s, n, m, e), and I don't think I could have come up with a more random mapping between these endings and all of their possible meanings if I tried. The endings for the adjective, for example, depend not only on the gender of the noun and its case (Nom, Acc, Gen, Dat), but also on whether you use the equivalent of "the", "a", or no article. And for all of those possible combinations, it's like they just pulled the ending out of a hat.

Chinese is hard for westerners because of the tonal aspect and because the writing is so hard, but I would guess that the grammar rules are simpler than German. I certainly found French, Italian, and Hindi more logical than this...

Therese said...

Excellent idea!

Eliza R. Snitch said...

I took three days of German at BYU before deciding that it was too hard for me. I took Japanese instead. Much, much easier.

Anonymous said...

I don't know about "neunZehn". When I first saw it, for a moment I thought "nine tens? 90? What?" I think plain old "neunzehn" is the way to go, even if you're camelCasing elsewhere.

Eliza, if as I imagine your native language is European, I'm really surprised you found Japanese more accessible than German. Not that there's anything wrong with that.

I was chatting once with a professor of Japanese, and asked if the class she was going to--fifth year, I think--was going to read the newspaper she was carrying. "Oh, no," she said, "they're only fifth year." Of course, that may have had more to do with the writing system than the language itself. Still, I thought it was pretty discouraging.

C. L. Hanson said...

Hey Anonymous!!!

Good point -- I'd leave it to native German speakers to work out the details of exactly which words should be considered compound words.

Regarding Eliza's point about Japanese -- I understand that Japanese writing is among the most complex in the world (because of the combination of Chinese word-characters with the Japanese alphabet), but it's possible that the grammatical structure is simpler to learn (fewer differently-inflected word families, fewer irregulars, etc.).

Holly said...

Chinese grammar is actually astonishing in its simplicity--they don't conjugate verbs, and the only noun declensions involve making a few things plural. Syntax is extremely regular. But German.... I had a few semesters in grad school for research. After the professor explained all the article system, he asked if there were any questions. I raised my hand and said, "Yes. Can we pause for a moment of silent indignation?"

He laughed, and said, "Most people do need a while to absorb this, so yes, we can pause for a moment." I still think it's an appropriate response. :-)

littlemissattitude said...

Yay, me. I remembered that Fenster is window before I saw the translation. My grandmother would be proud of me. I am abjectly ashamed of the fact that I remember so little of the German she tried to teach me.

Also, the sentence you illustrated with reminded me of how Grandma, even after decades of living in the US and speaking English most of the time, still used German syntax most of the time. "Make the window closed" or "Make the light out" were grammatical constructions that I grew up with and still love today.

Elaine