Thursday, February 21, 2008

Addendum to Up a Level


I think I'm going to start
a series of programming books called "What the fuck does this mean?"

I will be a co-author.

I will sit in a room with an expert programmer. I will hand them a basic tutorial question and they will write out a small response. Then they will hand it back to me.

Then I will scream "What the fuck does this mean?" And I'll hand it back to them.

They will re-write it. And hand it back to me. And I'll scream again. This will continue until I'm satisfied that what they have handed me is a coherent sentence and not some recursive brain-melting word problem.

The whole book will be written in this manner.

I may have to escalate to electric shocks during the process.

Up a Level


I think I've figured out
that my difficulty with programming isn't the programming language itself, it's the specific syntax used to describe the language.

Every language builds up its own specialized syntax. Even when there are common terms the implementation of those terms can vary wildly.

I'm looking at Python again. Figured I'd give it another go. Fine.

This, for example, is mostly gibberish to me:

"The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference, not the value of the object).

When a function calls another function, a new local symbol table is created for that call. A function definition introduces the function name in the current symbol table. The value of the function name has a type that is recognized by the interpreter as a user-defined function. This value can be assigned to another name which can then also be used as a function. This serves as a general renaming mechanism."

The tutorial hasn't mentioned local symbol tables. Call by value hardly makes sense since they haven't explained anything about an object reference. It's useless to me.

And this kind of shit is everywhere in "basic" tutorials. None of this syntax is the same in any programming reference I've ever seen. It even changes when you start talking about language variants or special extensions or "wrappers," whatever the fuck those are.

Not to mention that most beginner tutorials in Python do everything through the interpreter. This is, I guess, supposed to make things easier. But if you try to put the same stuff into an IDE text panel and then Run it from there, none of the examples work properly. Variables aren't initialized or you can't return a result from something something. No explanations whatsoever.

The tutorial starts so easy, too. Here is arithmetic. Here is a while loop. Oh, now here are twenty kinds of functions that won't work outside of the interpreter. No, we aren't going to explain any of the specific terms in use.

This is pretty much every programming tutorial I've ever read. It's like going to Cambodia thinking you have at least a conversational grasp of the language and suddenly you're confronted with a few thousand local dialects that sound almost nothing alike.

Bleh.