One of the more interesting questions facing schools now days is how percisely to teach people how to code. There are several schools of thought regarding this issue.
*-The hardcore programmers, who say you need to start from Assembler, moving individual bits around as if you're John Carmack himself.
*-The low level language advocates, who generally say teaching a limited subset of C or Pascal as an initial language, where there is an ability to handle memory, but the focus is on understanding data structures and program flow control.
*-Last are the High level/Object Oriented programming advocates, who generally are either trying to be low level and use C++ as a starting language, or just go to the logical conclusion of their arguments and teach Java/C# as a starting platform
Now I'll be giving my thoughts on this from the prespective of a student who has infact started in middle of the road fashion, with Pascal, and whose education now branchs both to the low level(x86 ASM) and high(C#).
Each of the solutions has it's own advanteges and disadvantages, however, before I go on, I want to make clear that the final decision on what is better, is obviously very dependent on the goals of the educational plan. If the plan is to serve assembly-line type-coders(which is another blog topic on it's own), then obviously, the latter plan of high level languages, is clearly better. If the goal is to create extreamly specialised and low level coders which will work on drivers and other such low level tasks, then obviously you have an interest in starting with machine level languages.
Assembler type-languages
Forgive me for blatently ripping off an amazing manual to assembly language, but it provides a very good explanation on this. From here.
To quote, why NOT to learn assembly language?
Assembly is hard to learn.
Assembly is hard to read and understand.
Assembly is hard to write.
Today, machines are so fast that we no longer need to use assembly.
These combine into pretty good reasons not to learn assembly language as a starter language, don't these? Howeve they're all arguments that can be worked around. Also, assembly language brings with it importent advantages.
Knowledge. Your knowledge of assembly language will help you write better programs.
This sums up why I'd support assembly language in any fashion as an initial programming language. The knowledge of how high level language commands translate into actual machine code is something that most programmers will not use in their day to day work, however the knowledge will help people write better code and understand efficient algorithms better.
That is, the understanding that when you define a variable in a higher level language you are setting aside memory in some segment of the RAM for a specific variable, or that you use a FOR loop command in a high level language the computer actully uses some registers that change state depending on run iteration.
This knowledge is not obvious, but is picked up by actully writing non trivial programs in assembler,something not very easy to do at the start of a persons education. This is why I'd rather teach a machine code level language at an intermediate stage of a persons education rather then at the start.
Low level languages-Pascal, C, etc.
Languages above the assembler level can't always be differentiated so easily, so I'll split them like this. Those who manage memory for you, and those who don't.
In this case, I'll focus specifically on Pascal as an example, contrasting to a language like C. The advantages of such a language is that it forces you to learn proper habits, learn how to write things without utilising the myriad of libraries available to any higher level language.
To give just one example, learning some of the basic data types, like stacks, lists, queues, is far more beneficial at this level of a language, as you are forced to learn what a Pointer is, what it is used for, etc. To repeat what I said about assembler, even if you never use the language or the specific knowledge(such as pointers), you will be a better programmer because of it. Just to throw an example, would anyone learning a memory managed language know what a Null Pointer exception is? No, because he would never have learned what a pointer is.
In this case, I would also reccomend a specific language, Pascal, because of it's requirments for proper coding, without any of the various shortcuts that you can use in C. The importance of gaining proper habits early on cannot be overstated, not in coding, nor in any other activity that is more difficult then walking across the street.
High level languages -C#,Java, etc.
There is not much to be said about teaching these languages. On one hand, there is low initial overhead before you can start writing non trivial code, this comes from having a large built in library of stuff you can use. On the other hand, the exact same thing prevents full understanding of what goes on under the hood, because it is all handed to you on a platter.
The main advantage quoted about these languages is that these are the same languages that most people will use in their jobs. The obvious reply is that once you know a low-level language, not only is it trivial to learn another language, but going up a level will be vastly easier, since there is actual understanding of how things function.
To sum it up
It is, as always a contrast between how easy it is to learn something, how relevent is it to the real world, and if it actully teachs you anything. I think the balence here is in the low-level languages, there is enough abstractions that you can focus on actual logic and learning how to code(without learning how to actully write,say, a FOR loop) while not abstracting the actual operation.
Does this mean a low level language alone will teach a person how to code in the best fashion? Of course not, esspecially as more and more code nowdays is actully written in a higher level language. However, there is an inherent advantage to learn how things actully function that enables you to learn how to best use a higher level language. A mix of all three levels of code(Assembler, low level, high level) is the best way I've seen to teach, with a focus on the low level.
Log in to comment