GAMES: GameSpot GameFAQs MOVIES: Metacritic Movietome Comic-Con
Tuesday, Jul 17, 2007

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.

Category: Computers
Posted by Acepace, 1:43am
3 Comments | Post a Comment

Comments

Page 1 
« prev  |  next »
4th year computer science here. They gave us the route of Java --> ARM --> C++. I see all the advantages and disadvantages of what you're talking about. Personally, the route we took worked...figured out what code can do, figured out how it was built, then practiced coding without 'safeties' so we could make mistakes and really learn how the intricacies worked.

(IMHO) The best way to start with coding is to make it VERY clear as to what the differences between the different levels are. That was the one thing I found my program did poorly. We were shown a pyramid diagram and given some techno-lingo that we did not yet understand.

If the coding is just for an aspect of the job, or as a tool, then probably cutting straight to the high level languages is the best route to go. If coding IS the job, then a general introduction followed by all levels of language (all introduced within the first quarter of the program) seems the best route?
Posted Jul 17, 2007 8:24 pm PT
Possibly. One thing a programmer friend of mine suggested, is using C as a standard, and going up and down as needed. You start using C to learn the concepts. Then you reimplement them in assembler, to see how they happen in practice. This is trivial using inline assembler. Then when you reach templates, classes, etc. you first go without them, see the need for them, then implement them using straight C. This will not only give you an appreciation for the use of objects, but will prevent Object-Happy coders. Which is disgustingly common.
Thoughts?
Posted Jul 19, 2007 7:39 am PT
My route: Pascal, C++, then assembly (with pretty much every other language you can think of thrown in there somewhere). Personally, I understand the approach of teaching from the top down, but I sometimes wish that I'd been taught from the bottom up. When I took my first class on digital system design, it culminated in a project that involved programming a PLD. I remember thinking that this sort of thing should be everyone's first taste of programming. But honestly, most of the better programmers that I've met learned their skill sets in less-than ideal ways. As long as you end up learning the right habits, it doesn't matter how you got there.
Posted Jan 31, 2008 2:59 pm PT
Page 1 
« prev  |  next »
  • Acepace
  • Level: 1 (0%)
  • Rank: Mogwai
  • Forum Posts: 13
  • Messages Read: 0


advertisement

Friends

My Friends