Search This Blog

Yesteryear

Friday, February 5, 2010

February 5, 2010

           Today’s jpeg is the code that operates much of the computer world, a code that, by every definition of code, really sucks. I’ll explain a bit more soon, but for now take a look at the strange punctuation, the stilted variable names and the truly idiotic camelhump typing. This code, supposedly the best product of a generation, instructs a single LED to blink off and on.
           A little trickier to spot are the fundamental errors of the whole system, such as the need to tell the code to “run once”, and the faulty context of “digitalWrite”, as if one can “write” anything to a light. Note the code uses no words normally associated with turning a light on and off.
           Another error is the spastic use of punctuation marks (although by many standards this snippet of code is surprisingly clean). Such code is fraught with logic errors, you have to memorize a new vocabulary just to read it. Least obvious are the “gronk” errors. A gronk error is a term I invented. I won’t go into detail, but a computer language is not an improvement if it requires too many shift-keys, too much punctuation, non-English commands and the most-used commands are not centered on the home row.
           More computer talk, but stick around anyway. Nobody knows who is going to write the next killer app. Programming is really not that hard to do provided one possesses at least some logical ability to understand cause and effect. Crashes and failures are generally not the fault of the computer, rather the programmer. There are certain pitfalls but you learn them all in the first semester.
           An example of a logical snag is the old “or statement” comparison. If a number is greater than ten do something, or if it is less than twenty, do something else. The logic error is in the fact that every number in the world is either more than ten and less than twenty, so the statement always evaluates to true. QED.
           Nearing then end of last century, programming had degenerated into a squabble of script-like nonsense, albeit nonsense that has great appeal to B students or lower. That appeal was well-documented by yours truly back in the 1980s. I was astounded how closely the coding of the weaker students resembled C. The C language is defective, not only in format but also in structure. The creature who “invented” dot notation clearly had no typing skills (a programming fundamental).
           The relevance here is that the C language has spawned countless offshoots, too numerous to mention. But the distinctive C legacy is there, with the programmers more concerned with error codes and button properties instead of generating good logical self-recovering code. I was able to review samples of commercial computer coding as it exists today. Guess what it looks like?
           By commercial, I don’t restrict that to financial. The code that makes robots and GPS devices work, even wristwatches, I mean all of it. Many consumers, without realizing it, have experienced another downside of the C language. When you get a device that is chronically hard to operate because each button has multiple functions, you are likely dealing with C coding. If you have noticed dissimilar devices often quit working in a characteristic fashion, blame it on C. But a certain giveaway is a user manual that does not seem to match the product—as stated, that is because C programmers are not focused on the same goals as the user.
           It was a sad day for mankind when C became a standard. The language itself is full of weaknesses, which explains the need for so many error codes. Features that are difficult to program are lacking on entire families of consumer products. Have you ever wondered why your optical disks have no true “fast forward”, but rather 2x, 4x and so on forward speeds? It works, but barely. Or why you cannot disconnect the passenger seat belt alarm without disabling your headlight warning signal. What? Oh, that’s easy, you want to disconnect it so you can set your groceries on the seat without the buzzer sounding all the way home.
           Remember the Arduino, the programmable breadboard circuit you connect to your PC with a USB cable? Now, even though I will never accomplish much with it, I want one. My training on computers has always been textbook. I can do all the classics like Fortran, BASIC and RPG, but I have no idea how to interface them with gadgets. It just was not on the curriculum back in my day. I’ve written around 16 large (exceeding 1,000 lines of code) in my life, but all were exercises. Still, that is 16 more than most people.
           Did you ever have a craving for clam chowder? If not, are you even American? Find the chowder from a can tastes just as good as the restaurant brand, if not identical. If not more than identical. The brand where you add milk, not water. Now that is happiness.