# Is it more effective to teach low level languages before high level ones or vice versa?

When structuring a Computer Science curriculum, which prepares students most effectively for a career in technology today? Consider the following scenarios over a student's college career:

• Starting with low level languages like ASM and C, working toward higher level (i.e. more forgiving) languages like Java, Python, etc.
• Starting with higher level languages and then diving deeper into lower level ones.
• Possible duplicate of Should assembly language be taught in an introductory course (or soon after)? – Peter May 27 '17 at 7:42
• Disagree. That question is specifically asking if assembly should be taught at all. In today's world, C is considered low level. – BrDaHa May 27 '17 at 7:44
• Fair enough. I see the distinction you are attempting to draw. – Peter May 27 '17 at 7:55
• I prefer to teach high level first, and thing that we are usually not high enough. However I have seen one teacher start with very low-level, and hardware. I fully agree with what this teacher did. I would say very high or very low, not in-between. Also do not try to follow the course of history, the history of computing is important, but this should not dictate the order of learning. – ctrl-alt-delor May 27 '17 at 11:28
• A good balance of both would be best. One of the new courses focuses more on higher level languages, but doesn't neglect lower level languages either. – user223 May 27 '17 at 19:26

Well, straight-forward: It depends:

1. If the low level language you are thinking about teaching has complex code paradigms and is very abstract, then teaching it first would not be a good idea.
2. However, if your low level language is one that caused newer, high level language to be created, then teaching the low level language can aid the students in understanding some core concepts of the newer language. They might be able to spot those concepts in other languages, too (making a sentence like "oh, just like in <insert low level name here>!" quite common)

Personally, if I faced a low level language like the one described in 2, I would only teach a few things. The students needn't be "fluent" in the low level language, as it isn't widely used in the "career market". I am not quite sure how widely C is used, but I am pretty sure that it is used less than C# or java (and certainly less than python).

So in essence, knowing the main ideas of the low level languages can be useful, but it is less important and useful than knowing high level languages.

As for a foundation for building knowledge, it goes back to teaching the main ideas of low level languages (rather than teaching the entire language), and then teaching the high level languages.

• I don't doubt that teaching a low level language is beneficial, but it's more a question of which is better as a foundation to build knowledge on: low or high level – BrDaHa May 27 '17 at 16:54
• @BrDaHa I see your point. I'll add more to the answer. – ItamarG3 May 27 '17 at 17:15
• @BrDaHa edited the answer. – ItamarG3 May 27 '17 at 17:18

Similar to Itamar Green's answer, if I designed a course this way, I would only focus on one or two tasks in the lower level language. But even so, I might avoid this approach for introductory students. There is a beautiful course on Coursera that takes this approach called Nand to Tetris. It is deservedly well-reviewed, but it is not appropriate for total newbies.

The problem is that, at least for introductory students, lower-level languages often require you to have a fair amount of rather abstract knowledge about how numbers and memory work. Taking 'C' as en example, we might add two positive numbers and get the correct answer (yay!), a negative number (integer overflow), or a smaller positive number (truncation). These are all important issues worthy of discussion in a broader CS curriculum, but are highly technical for students who haven't necessarily mastered the oddly-ordered format of a for loop yet.

And of course, when you do get to loops, since they're beginners, they'll make infinite loops. And when you do that, you might well try to write outside of your allocated memory area, and you wind up with the infamous Segfault, which is both very unhelpful for beginners (who already aren't great at reading error messages), and sometimes feels like the only damned error you ever get while writing in C.

• Personally, the infamous error I would get when learning C was SEGFAULT :) – BrDaHa May 27 '17 at 16:17
• Lol, yes, thank you!! Slip of the tongue there :P Conceptually similar errors, though. – Ben I. May 27 '17 at 16:19
• If you, and your students, find the for loop syntax odd, start with the while loop first. (Set x, test x, increment x). Then "roll it up" into a single for loop. – Gypsy Spellweaver May 30 '17 at 13:55
• I'm not confused by for loops :) But the ordering of the operations causes confusion. Looking at for (1 ; 2 ; 3) { 4 }, you would expect the operations to run in a similar order, but they don't. Students seem to regularly get confused by this hidden ordering trap - they need to understand the ordering as (1,2,4,3,[2,4,3...]) – Ben I. May 30 '17 at 14:02

It may depend on the background of the student. If you are teaching business, language, or liberal arts majors to code, I would use high level languages. These are more like English, and conceptually more accessible to these types of students.

If I were teaching hard-core math and science students, I might use low level languages. For instance, students studying assembler languages will understand the difference between "accumulation" and addition, and be better prepared to understand commands like X=X+1. Even at the most elementary level of "machine" languages, these students are more likely to understand "bits and bytes" than the students described in the previous paragraph.

A bigger question I have experienced is: Should we start with Procedural and then Object Oriented or the other way around? (We long decided to start with Console and then go to Windows later, because jumping straight in to Windows is like throwing them in the deep end of a pool with no water in it.)

Starting with Object Oriented is just too weird and abstract. It does not teach people how computers work. So, they must learn some procedural concepts (decisions and loops) first. Once they can actually write some kind of program that takes some thought and they can use methods and parameters, then you can introduce Classes. (The pool that has water in it.)

To answer your question, we have settled on C# as the most likely thing they will use in the workplace (along with a dose of SQL and database concepts). As a former C and assembly programmer, I explain all along how it all grew out of C which grew out of earlier languages. I make sure they have some idea of the low level functioning of the computer all the way through. Without that, what in the hello-world do they really know?

When we do get around to Windows, I can't resist showing them the canonical message-loop program from Petzold's book in 1990. Yes, C#.Net is a wonderful thing! At the end of the curriculum we invert everything they have learned by teaching them ASP.Net: no persistent state, no Main(), no nothing familiar... (Aaaaaaahhhhh! The pool on a spaceship with no bottom at all.)

It is very effective.

• I really like your answer, and I think it's really interesting but it's not really answering the question. If you wanted to, you could post a new question and self-answer it. – thesecretmaster Jun 14 '17 at 19:15
• @thesecretmaster It does answer the question. I said: teach C# (a high-level language) while explaining how it works at a lower level. It is different from the other answers, and it bypasses the "which one first" aspect. The students learn something they will definitely need for the workplace, and they understand how it functions. If there is actually a better answer than this, I would love to have it so that I can improve my curriculum! Perhaps you would like to post an answer? – user737 Jun 14 '17 at 19:22
• I'm not trying to insult your answer. There's a reason I haven't answered, and that is because I couldn't write an answer as good as yours. I just think that it will get less attention on this question than it would if it was it's own self answered question. Feel free to totally ignore what I'm saying, It's just a suggestion. – thesecretmaster Jun 14 '17 at 19:26
• @thesecretmaster OK. On other SE sites, posting a question so that I can answer it myself is often considered 'bad'. I have had more questions shot down than accepted. I discovered this site and thought that maybe I would fit in better here... Do teachers have a sense of humor? Let's find out. – user737 Jun 14 '17 at 19:28
• Self-answered questions are supposed to be encouraged on SE sites. Older, more established communities sometimes don't follow that guideline however. There's even a button for you to do that. The problem is often that it's hard to ask a quality question when you already know the answer. Not that it can't be done, just hard. Good method is to ask yourself "If I saw this question in the review queue, how would I rate it?" Self-answered questions are a perfectly valid way to share knowledge on SE. – Gypsy Spellweaver Jun 14 '17 at 19:46

My clear preference is to start in a high level language and introduce low level concepts (1) as needed, and (2) later in the curriculum. This is in spite of the fact that over my long (45+ year) career, I worked in low level languages early on as that is the historical development. I also struggled each time I had to "up my game" as the path from low level thinking to high level thinking isn't necessarily clear or easy. A stone age human, while fully human and having the same mental capacity as modern humans (which they were), and probably an expert (if male, anyway) in creating stone tools, would have a terrible time trying to understand a socket wrench, though a hammer might be easy enough.

However, I don't believe that my students should recapitulate my experience as much of what I learned is now actually obsolete. Flow Charts for example, though some will disagree.

But the real reason for starting in a higher level language is that I'm trying to teach students to think not to code. Higher level languages provide higher level concepts (duh), so provide a more amenable environment for teaching thinking.

I also want students to be able to build modern software, not the kind of thing I built before 1980. They need practice at that. A lot of practice. Modern software builds big things out of small things. The things inter-operate in complex ways, but if I try to build complex things out of complex parts I wind up with a mess. Build big and complex things out of small and simple things. Both object-oriented programming and functional programming emphasize this. A Scheme function returns a single thing, ideally without side effects. Java classes, if well designed represent simple compositions of still simpler things. Of course it is possible to misuse such languages, writing thousand line Scheme functions or hundred method Java classes.

Of course, it is possible to use C as a higher level language, though most programmers don't. A C program could consist of a thousand 4 line programs and be much better than a four thousand line monstrosity that is impossible to understand. Part of the problem is that C was invented at a time at which "subroutines" were rarely used, and only for those things that people thought would be reused.

Actually people learned long ago that reuse is a false deity. Don't worship it. Even in the Algol days it was understood that decomposition into parts was for simplifying the understanding of a problem. High level languages are intended to put a premium on this way of thinking.

If you teach them to think, they will be able to code.

Considering Computer Science/Engineering you should use a general language. I.e. Modern-C++ (C++11 and after).

There are many outdated misconceptions about programming languages and C++ in particular:

1) C++ is not an object-oriented only language. it is used any way you want it to.

2) Modern C++ dose not use pointers anymore or any of the traumatizing old-school coding practices.

3) Modern C++ allows you to go as low-level to as high-level as you want. You could go as high-level as ignore data types. And you can do procedural programming or OOP. and you can go as low level as write assembly in your C++ code.

A Language is only the tool. With a general language like C++ you decide what/how to teach your students instead of wasting your time teaching different languages' semantics every time you want to approach a different subject.