11 ms·
And here we have the reason why just about every single CS department in the US teaches Java instead of C or Scheme.
by javanix 17y ago
And here we have the reason why just about every single CS department in the US teaches Java instead of C or Scheme.
- amichail 17y agoJava is an improvement though, especially under Eclipse. Even better would be using Python followed by Scala. Perhaps the issue is that too much class time is spent teaching details of a language and its libraries.
- javanix 17y agoYes, the hours upon hours of instruction in basic CS courses that were devoted to the various mundanities of Java abstractions drove me nuts. I'd much rather have spent that time learning the more-useful mundanities of memory management in C.
- Locke1689 17y agoNo. Java and Python and Scala are not improvements. Why? They're too easy. Pointers are hard (relatively). Compiler design is hard. Complexity theory is hard. A loss in any one of these sections is a loss to the degree as a whole. The ACM ICPC helps a little in promoting intelligent problem solving (every CS student should be able to write a program to use Dijkstra's algorithm in under 20 minutes from memory), but it's the university's fault in the end. Fortunately in the United States, some of our top universities seem to have (thus far) escaped the treatment that other ones did. Stanford, Yale, Caltech, MIT, CMU, et al. all continue to teach very much the same curriculum that they taught intro CS students 10 years ago. Systems is a required course and taught in C. Intro programming is a required course and taught in Scheme/LISP. Unfortunately, many schools did not fair so easily and now teach Java or some-such exclusively. I think that this is partially to blame for the number of unfortunately bad computer science students with degrees. How to change this, I have no idea.
- cpuddle 17y agoAbout pointers being difficult...I don't think that pointers are difficult to understand. To me it was more the syntax C uses that got in the way.
- gacek 17y agoYou have got to be kidding us. But I don't really get it - what is difficult in & and * operators? I do teach programming, and most of the time I see both the concept of pointers, and syntax is pretty understandable. The real trouble begins when you expect students to use them to their advantage - but it really is beyond syntax.
- cpuddle 17y agoUnfortunately I'm not. I tried learning C as my second language after VB and the syntax seemed unnecessarily complicated to me (like '->'). As a newb, you get bogged down in the details and knowing the cases for when to use &,* seems like an added complication.
- tetha 17y agoSee? This syntax trouble is already lesson #1 you learn from pointers: The _address_ of some value and the _value itself_. If you have a pointer (that is, the address), then you need to prefix it with a * in order to get the value in order to do useful things. If you have a value, you need to prefix it with & in order to get the value's address in order to pass it around more efficient (at least it will be more efficient if it is some large data blob). Did anyone ever mention addresses and values and their difference when looking at Java from a users point? Not to me, to be honest.
- Retric 17y agoPointers are easy. I thought several people in our CS program how to use them in ~2 hours. What's hard for most people is thinking abstractly between what the code looks like and what happens when you run it. Pointers are simply the first thing that forces most coders to consider that split. But, a reasonably competent JAVA developer moving to C can pick them up in little time. The problem is reading other peoples C code that looks more like line noise than structure. But, pointers are a tiny step along that path.
- amichail 17y agoI would agree that low-level programming should be taught at some point. But one course is sufficient and it could be one that is taken in second or third year. Low-level memory issues should be avoided whenever possible by using a higher level language. There's a reason why garbage collection was invented.
- Locke1689 17y agoDepends on what you're studying. System programming is and should always be done in C/assembly. Personally I am doing virtual machine design in C at the moment.
- endtime 17y agoSadly, you are not entirely correct. Stanford's intro course uses Java (though learning C is also required) and MIT just switched from Scheme to Python.
- thras 17y agoI'd rather see C taught than Scheme. Hardware matters, and a good CS-education should be centered in languages that recognize that. Software engineering, on the other hand is too important a subject to be left to the schools. Let them learn Scheme on their own. They'll appreciate it more that way.
- javanix 17y agoC would be my first preference as well, but I also appreciate that Scheme (or another functional language) would provide better opportunities than C or Java for students to learn more "advanced" algorithmic techniques such as recursion. The problem with Java (and C, to a lesser extent) in basic problem solving is that you can almost brute-force-code and get a working solution that will get full credit, but after writing it a more elegant (and efficient) solution isn't always obvious. In functional languages, that "more correct" solution almost always seems to stand out more, at least to me.
- sketerpot 17y agoRecursion is only considered an "advanced" algorithmic technique because people are taught to think of it that way. Recursion is actually pretty straightforward once you have a bit of practice using it.
- javanix 17y agoWell, yes, most things do become easier with a bit of practice. If a functional language was taught in beginner CS classes I think it would be easier for students to see how it works. It certainly "clicked" for me once I'd learned a bit of Scheme in my first AI class.
- Locke1689 17y agoIntro CS courses at MIT, CMU, and Northwestern are taught in Scheme.
- 17y ago
- tybris 17y agoThe real failure here is the words "instead of". It's really not hard to learn both and especially good to learn when to use which.
- deleted 17y ago[deleted]
- jzachary 17y agoMy god. It's truly amazing how any technical or academic topic seems to degenerate into a Java vs C debate. Is there a law for that?
- tetha 17y agoI think the "Java <-> C"-debate is an instance of the problem "Should studying computer science be mindwreckingly hard or should studying computer science make you able to program things?". Plus, you can also bash Java in this special instance, which is always nice coughs. Other instances include "Compiler construction or not?", "Theoretical computer science or not?", "Assembler or not?".
- javanix 17y agoThat would hold up if learning a bit of memory management was actually "mindwreckingly hard".
- DarkShikari 17y agoAfter reading the first sentence of said post, I actually thought he was trying to criticize Java.
- tetha 17y agoAnd then you had to debug something which resulted from corrupted pointers into the stack, partially being still good data and partially being nonsense.
- omail 17y agoAt my university, Intro to Prog. is in C and C++ (yes, both), and the course that immediately follows is in Scheme, some made up language (we had to build an interpreter for that language in Scheme) and Haskell (for the motivated students).
- scott_s 17y agoI think comments like there are border-line trolls in a community like HN. The languages used in various parts of a CS curriculum are one component to the whole. Holding up that component as the reason that the sky is falling is, at best, disingenuous. I can construct terrible CS curriculums that start with C, and terrific ones that start with Java. If those who construct the curriculum want the beginning courses to focus on algorithmic thinking, I think it's fair to use a language that abstracts away much of the physical machine. The abstractions can be peeled away in later courses. If, instead, they want the beginning courses to focus on the realities and difficulties of dealing with computer systems, it makes sense to start with something like C. They can then introduce the abstractions that let people manage those difficulties in later courses. I think both approaches are valid, as long as a student gets a view of the important points of the field. I can even see arguments why one approach might be better than the other. But claiming that one approach represents the failure of our CS academic system is zealotry.
- gaius 17y agoYou have to meta it one level. The reason C was taught was because it was close to the machine without actually being assembly language. That's pedagogically useful because it exposes the student to all the properties of the Turing machine without having to be too specific about implementation (not that MIPS assembly isn't also a good choice). Similarly, the reason to teach Smalltalk is to teach OO, the reason to teach Lisp is to teach Lambda Calculus. The only reason Java is taught is because students demand it because they've heard that if you know Java you can get a good job. Now, that doesn't imply that Java shouldn't ever be taught. But the reasons for choosing any language should be academic reasons. Particularly, it is bizarre to see academia trailing industry in language adoption.
- scott_s 17y agoYou claim that "the only reasons Java is taught is because students demand it," and it appears your objection is based on this claim. Do you have any support for this claim outside of your personal belief? My undergrad made the switch to Java right before I graduated, and they are a counter-example to your claim. Also, I doubt your claim about C is true. C was used because it was close to the machine without actually being assembly. I suspect C was then taught because it was used everywhere.