Next:Algorithms
Up: Overview
Previous:
Introduction
What is Wrong With Computer Science?
Computer Science is still just a child amongst older, more practiced, and more well understood disciplines. It is like alchemy, in that it exists in state between science and art, often viewed as magic by those on the outside. Even we who practice it don't completely understand its true nature, or where it fits in amongst other academic subjects. It is in desperate need of formalization.
The hacker mentality is still very much the dominant mind set. Not that this is all bad; hacker's methodologies are very good for getting things done quickly and efficiently, but are very poor for communication and logical analysis. Programmers that hack tend to think by intuition, having already internalized the basic logic of how to write code. In doing so, they tend to not realize how many steps they're skipping when trying to explain to non-hackers the sorts of mental processes that they work by.
Non-hackers that are trying to learn suffer when faced with this sort of obstacle. Those (including myself) who learned how to code by the "maverick" style, through one's own discovery with little to no guidance, tended to figure things out much differently. They'd pick up one or two tools, such as variables and conditional's, and would then combine them in every possible manner, figuring out the nuances and details of the semantics involved in such constructs. Eventually, they'd run into a point where they'd realize there was something missing, and would investigate other features that were available. The end result was similar to building a wood shop project with only nails and wood, bypassing entirely screws / power tools / and saws. It wasn't pretty, and it wasn't very architectural, but the fundamental principals of the subject were entirely and thoroughly internalized. Higher level concepts, like generalized algorithms and object hierarchies, hadn't even crossed the mind. But that's alright, as learning and exploring the basics first was more important.
We're still teaching like hackers, and this needs to change if we ever want to see some acceptable success rate for those being introduced to Computer Science. The basic reason is very simple. Hackers like being tricky (though they usually don't realize it). And those on the receiving end of trickery tend to get confused. Hackers enjoy teaching multiple ways to do the same thing, such as a "while..do" loop versus a "do..while" loop, or computing formulae by functional-style expressions versus imperative-style mutators, and then proceeding to show the slight nuances between the different approaches. This is a poor teaching method since the beginner does not share the same mastery of semantics that the hacker does, so the beginner winds up left behind. Hackers also like to spit out a whole page worth of code, and then analyze step by step what the parts do and what the interaction yields, also known as debugging. Again, this works fine once one already knows what the individual pieces do, but a beginner has much better luck working bottom-up, by composing small chunks together in a way that makes sense.
The difficulty that Computer Science faces is that it has no strong foundation of principles, which is why it often avoids the bottom-up approach. It has no prior model of parts upon which to build, whereas other disciplines do, for example, biology which builds upon basic chemistry, political science which builds upon social studies, and calculus which builds upon algebra (which in turn builds upon arithmetic). So instead, the Computer Science teacher throws everything at once into the open, and has to simultaneously explain data structures, syntax, the environment, variables, and algorithms all at once. This is a poor approach, as the student has no insight into why each individual subject is needed. And also, because as every good software engineer knows, introducing too many new changes at once leads to nothing but problems.
The alternative, as presented here, is to use assembly on a virtual machine, which is sufficiently abstract, to provide a solid foundation upon which programming and software engineering may be taught. First off, the fundamental concepts of instructions, state, discreteness, and atomicity are introduced, and then this vocabulary eases students into composition, then control, followed by data structures and eventually algorithms. This order is both logical and incremental, helping students learn based upon only lessons already internalized, while still understanding the purpose and need for each tool in their repertoire.
To assuage any fears of using assembly as an introductory language, the machine in question, Rex86, has been streamlined as much as possible, making it appropriate for use by any beginner. It exhibits the following useful simplifications:- No explicit memory access
- Minimal, and very orthogonal, instruction set (25 total instructions)
- Single instruction I/O (named INPUT and OUTPUT)
- Native data types for text and integer lists are built in
- Only 4 registers (AX,BX,CX,DX)
- No complex jargon, hardly any technical terms at all
- No duplication of concepts (for example, comments and labels are combined into notes)
- All algorithms in class and homework can be written in under 30 lines of code
This simplified architecture cuts away all unnecessary details, allowing the course material to stick to the core essence of what programming is.What is the Core Essence of Programming?
- Logic - Being able to find rationales and reasons for the correct workings of code via implication is one of the first skills practiced by a programmer.
- State - Having a rough concept of what is entailed in the information contained in a machine, along with how such values change at each step of operation, is pertinent to all program analysis.
- Interpretation and Representation - All data is inherently ambiguous. A stored value in a machine is meaningless without the original context supplied, and it is up to us, as humans, to reconstruct what any data is meant for.
- Structure - Turning chaos into an order is one of our primary goals as Computer Scientists. It allows us to provide as much meaning to information as possible, to ease in the correct future interpretation of said data.
- Iteration and Counting - Doing the same exact thing repeatedly is the most striking example of what a computer can do better than a human. Being able to enumerate some set to find its size comes naturally from this, and is one of the most common utilities taken advantage of.
What isn't the Core Essence of Programming?
- Precedence Rules - These can get so complicated even many experts can't remember them all. Instead such programmers rely on liberal use of parenthesis or compiler warning to get their code correct. Imagine how much worse the situation is for a novice.
- Evaluation Order - Again, trying to get a beginning to get operator evaluation rules correct is just another example of a hacker trying to trick his audience with an obscure rule set.
- Syntactic Sugar - Using "for" instead of "while", or omitting curly braces when they are deemed unnecessary, or even using "elseif" instead of nested "if"s, all distract from the reality of what's happening within the machine.
- Algorithms - Algorithms are often viewed as a central concept to Computer Science, but really they are only a tool. Their real value comes from the fact that they incorporate aspects of the few truly important ideas listed above.
Next:Algorithms
Up: Overview
Previous:
by dlong@progmatism.com. Plz don't copy kthx.