5 ms·
>Joel Spolsky wrote a great article[1] in 2005 that basically says using a massively high level language like Python or Java as the core of a CS curriculum is d
by cube13 13y ago
>Joel Spolsky wrote a great article[1] in 2005 that basically says using a massively high level language like Python or Java as the core of a CS curriculum is damaging because the languages aren't "hard" enough. As curmudgeonly as it might sound, I'd be inclined to agree. Even though I rarely write C code anymore (we do everything in Java in our lab), the underlying understanding of memory management that is acquired from having to learn to handle it manually has been invaluable to me as a programmer.
Python and Java are great starting languages, especially for the first introductory course. You're really only learning the high level concepts like basic language syntax(Why are there so many semicolons???), program flow control(functions, if, for, while statements), working with computer memory structures, and basic boolean logic. At that point, an easy to understand language actually makes more sense, because the students are working more with the concepts than with the language.
After that, when you're teaching data structures, it's important to know how the memory is allocated and how that can effect your implementation of the structure. C/C++ are good languages because they force students to deal with memory allocation and pointers. They also don't have pre-rolled data structures like python or java, which is important because the goal is to learn how the structures work, not how to use the standard language libraries.
- plg 13y agoMy opinion is that one can easily teach these "high level concepts" (loops, syntax, control flow, etc) using C. Furthermore my (admittedly curmudgeonly) take on the C vs "high level languages" debate is that learning something like Python "first" because it's "easier" is actually sort of damaging, in that the student will learn these "high level" concepts without any clue about the underlying implementation. They will then have to learn a bunch of "bag of tricks" that will seem arbitrary to them, and a bunch of "gotchas" to avoid, again, that will seem arbitrary to them, because they have no concept of things like the cost of memory copying (passing-by-value giant arrays as arguments to functions, etc). I actually think that someone who is incapable or even worse, unwilling to learn programming using C, has no business programming anything at all of any import, beyond the most toy-example tiny scripts here and there.
- cube13 13y ago>I actually think that someone who is incapable or even worse, unwilling to learn programming using C, has no business programming anything at all of any import, beyond the most toy-example tiny scripts here and there. I'm a C hacker, and I do agree with this 100%. And keep in mind, when I say "introductory", I'm talking a 1 semester class at most. I'm not saying that it should necessarily be any more than that. >Furthermore my (admittedly curmudgeonly) take on the C vs "high level languages" debate is that learning something like Python "first" because it's "easier" is actually sort of damaging, in that the student will learn these "high level" concepts without any clue about the underlying implementation. They will then have to learn a bunch of "bag of tricks" that will seem arbitrary to them, and a bunch of "gotchas" to avoid, again, that will seem arbitrary to them, because they have no concept of things like the cost of memory copying (passing-by-value giant arrays as arguments to functions, etc). Honestly, starting out with C++ when I was in my early teens(I'm in my late 20's now), a lot of those "bag of tricks" stuff I use daily was pretty much magic to me for a long time. It wasn't until I started to learn about dynamic memory management and serious data structure concepts in high school and college that it began to make sense. That's why I think that the higher level languages are great for learning the basics of program flow control and basic computer data handling. The students don't need to know how dynamic memory allocation works at that point, but they will soon. The overall point is that a well rounded, theoretical CS education should be teaching that the languages we use are closer to standard tools than the end-all of our products. There will be times where a high-level language will suit your needs perfectly well, and times where a low level language will have the raw power that you need, with the caveat of potentially needing a lot more thought and work to get the same results.
- betterunix 13y ago"My opinion is that one can easily teach these "high level concepts" (loops, syntax, control flow, etc) using C." Then one day you have a line of students going out the door at your office hours who all need help understanding why their program is segfaulting. Some tried to free a pointer to something allocated on the stack, others tried to free a pointer twice, and one or two managed to find some undefined behavior that even you did not know about. It is not that C lacks high-level structures, it is that any non-trivial C program must deal with low-level issues. "the student will learn these "high level" concepts without any clue about the underlying implementation" That is what computer architecture and compilers courses are for. You learn more about the implementation of your programs by writing a compiler than you do by using C, and writing a compiler in a high-level language is almost always less painful than writing it in C. Somewhere in the compilers course students should also learn how a garbage collector works, which will help them understand why they are seeing the behavior they see.
- bitwize 13y agoLike a lot of thirtysomethings I learned on a home microcomputer, and on those the order was: BASIC, then assembly when you found out that BASIC was too slow and flabby, then a compiled language such as C or Pascal when you found out that writing anything serious in ASM was like trying to build a ship in a bottle with lentils, toothpicks, and glue. Similarly the three core languages of a CS curriculum should be Python, followed by assembly, followed by C. The assembly background helps prep you for the gnarlier C concepts like pointers, so it's important to get that in there first before dropping someone into C. C is a systems language whose intended audience is people familiar with assembly but in need of something a bit easier to manage.
- dragonwriter 13y ago> Like a lot of thirtysomethings I learned on a home microcomputer, and on those the order was: BASIC, then assembly when you found out that BASIC was too slow and flabby, then a compiled language such as C or Pascal when you found out that writing anything serious in ASM was like trying to build a ship in a bottle with lentils, toothpicks, and glue. That's certainly one plausible order, though more of people I knew (about the same time, though I'm technically just out of the 30-something range) did BASIC followed by Pascal, followed by C, followed by Assembly. Rather than BASIC -> Assembly -> Pascal/C. > The assembly background helps prep you for the gnarlier C concepts like pointers, so it's important to get that in there first before dropping someone into C. I personally think its at least as easy to learn pointers in C (or even first someplace where they are more opaque and you don't engage directly in pointer arithmetic, like Go or, I think, Rust, or if you were me in the 1980s, Pascal -- and then C) and then learn Assembly than the other order. > C is a systems language whose intended audience is people familiar with assembly but in need of something a bit easier to manage. Sure, and when C was invented, that was probably a common route among people who were already programmers; but its a bridge that can be crossed in either the assembly-to-higher-level direction or vice-versa, and seems to me to work quite well either way.
- lttlrck 13y agoYes, with even a basic understanding of assembly all the pain of pointers disappears. I taught myself assembly from the output of Borland C because I needed more speed (for a platform game). I was hand-optimizing compiler output and turned out to be an amazing way to learn. > C is a systems language whose intended audience is people familiar with assembly but in need of something a bit easier to manage. A larger part of that is portability, which is a lot easier to manage.