7 ms·
Anyone even considering teaching Java as a first language to high school students should be given a good sound slap - and I say this as a Java dev.
by macavity23 15y ago
Anyone even considering teaching Java as a first language to high school students should be given a good sound slap - and I say this as a Java dev.
- hbhanu 15y agoMy freshman and sophomore years, I was taught Java... the rest of undergrad and grad, I was living in a world of C and Matlab. I have no idea why it was taught in that order, and I think they're in the process of fixing it, but I remember my first C course when we started doing pointer arithmetic... quite the experience!
- Symmetry 15y agoIts better than C++ at least, which I learned in High School.
- navs 15y agoI'm only 24 and I was learning BASIC in High School, back in Fiji.
- rollypolly 15y agoI think BASIC, Python, and other simple languages are much better than C, C++, Java. Those latter languages are like teaching someone to swim by pushing them off the deep end.
- tlear 15y agoI think BASIC is probably a better language to learn first then Java. In a perfect world I think kids would be taught Lua, Python or Ruby. Now that I think about it even Javascript would be much better to teach then Java
- admg 15y agoI'm 25 and was using comal in high school, seems to have been a particularly rare language.
- scott_s 15y agoYou can do just fine with C++. Or Java. I have taught new programmers using both. I think you can do better with Python, because there's less initial friction. I'd rather not have to tell students to ignore "public static void main" because there are several concepts in that phrase alone that I'd rather they not worry themselves with. I want them to focus on developing the ability to think algorithmically. But, as I said, you can still do this just fine in C++ or Java. I think that people tend to place way too much importance on the first language we teach students. What matters far more is the quality of the teaching itself, and the relevance and logical progression of the projects the students have to solve.
- kingkilr 15y agoI think it matters more than you give it credit. Michigan State did an experiment where they replaced one of the Intro to CS classes (which were formally in C++) with Python. The result they found is that for people who went on to CSII (in C++), they did just as well; but for people who were non-CS majors, a) they did significantly better than non-CS majors starting with C++, and b) they were more likely to take more CS courses. So if you're someone already committed to programming or computer science, maybe it doesn't matter, but if you're trying to get your feet wet, it matters a great deal.
- scott_s 15y agoI looked up those two papers: "Python CS1 as Preparation for C++ CS2": http://www.cse.msu.edu/~enbody/fp039-enbody-revised.pdf http://www.cse.msu.edu/~enbody/fp039-enbody-revised.pdf and "Performance of Python CS1 Students in Mid-Level Non-Python CS Courses": http://dl.acm.org/citation.cfm?id=1734437 http://dl.acm.org/citation.cfm?id=1734437 (email me if you'd like a copy, it's behind the ACM paywall). Neither of your claims is supported by either paper. Rather, they seem to support my claim: starting language isn't a predictor of success. Conclusions from the first paper: When final exams were compared for a CS2 course offered before the Python transition with a course after the transition no statistical difference was found. The first CS2 course after the transition contained a mixture of Python-prepared and non-Python prepared students. There was no statistical difference in the performance between those two student groups. Conclusions from the second paper: We conclude that starting students with Python has not had a negative impact within a C++ based curriculum. It would have been nice to conclude that the Python students did better in these courses, but the evidence does not appear to support that hypothesis. With that said, I do agree with the authors that exposure to more languages, environments and tools is a good thing, and for that reason, I'd prefer using Python, then switching to C++.
- mhurron 15y agoWhy? What is so bad about Java that it makes learning it so bad as a first language or as a introduction to programming?
- kingkilr 15y agoBecause the hello world program has so much boilerplate. It means from the get-go you're telling students, "Don't worry about this, and this, and that; ignore it and we'll explain it later." You could go months into learning programming before you need to understand what a static method is, but it's right there in your first program.
- sirclueless 15y agoHaving tried to tutor beginning programmers in Java, there are a lot of things that bug me. There is a lot of boilerplate and cruft that must exist in order to get anything done, and the type system and visibility just gets in the way until you want to teach people how to architect large programs. Each class must be in its own file, and the execution starts from "public static void main(String[] args)" inside it. Then you have to deal with complex data types very early: python's set of primitives is much richer, which is great when teaching. Also, doing IO in Java is a pain unless you distribute a library. To those who think Python's significant whitespace is a problem, I think you need to watch an otherwise intelligent beginner struggle with an error on line 80 because they mismatched their braces on line 20. If you aren't properly indenting your code, it becomes an unreadable mess anyways, so why not enforce it at a language level? And if you think an IDE can do this for you, think again. People just complain that it does things wrong when it indents half their methods by 2 extra tabstops because they missed a brace. They don't really get it, they just get into a feedback loop where they say, "Oh, it won't compile. Let me scan the entire program counting braces" which is a waste of everyone's time. I've seen people go entire semesters without ever learning to write readable indented code.
- UnFleshedOne 15y agoI "got" indentation after spending 2 days hunting down some bug in calculations only to have the teacher take 1 minute to reformat the code and another minute to point out an instruction that was sitting in the inner loop. With proper formatting it was a glaringly obvious mistake...
- tantalor 15y agoThe College Board Advanced Placement exam for Computer Science has used Java for several years now. See http://apcentral.collegeboard.com/apc/public/repository/ap-computer-science-course-description.pdf http://apcentral.collegeboard.com/apc/public/repository/ap-c... I'm not saying that's a good idea, just that the practice is fairly common. I think they're nuts.
- eli 15y agoPrior to that it was C++. I think they're actually moving in the right direction.
- gaius 15y agoCompare Hello, World! in the two languages, in terms of new concepts that need to be known to understand it. In C++ you need to know about including <iostream> and cout. In Java you've got all that class, public, static, blah blah nonsense.
- Jach 15y agoI did a presentation at my old high school about why programming is awesome in general, and had a couple notes on this. I counted 18 unique facts that need to be mentioned in order to completely understand a Java Hello World, and 25 for C++. For Python, it's either 4 or 5 depending on whether you start with the REPL or not.
- Turing_Machine 15y agoIn Javascript it's either: document.write("Hello, world"); or: alert("Hello, world"); Two lines of overhead counting the script tags. For all its faults (and they are many) I think I'd argue for Javascript as a first teaching language (maybe focusing on Crockford's "good parts", or maybe some variant like Coffeescript). Minimal overhead. Support for reasonably advanced concepts like objects and anonymous functions. Will run on just about any device the student (or his or her friends own) without having to install anything. Trivial to distribute your creations. Has actual employability value (this, I think, is sole reason Java has become so popular). I don't want to get bogged down in the argument over strong/weak/dynamic/static typing -- but also don't think it's necessary for a beginning course.
- adestefan 15y agoWhen I took the CS AP test in 1997 it was in Pascal. It was shortly changed to C++ and then was switched to the current Java. Most of my college CS (1998-2002) courses were in C, including first year courses. As it turned out my senior thesis was a Pascal compiler written in C that targeted the early JVM. Man I should have stuck with that, but my conclusion at the time was, while it was easy to target, the JVM was just too much baggage to carry around. Personally, I think Pascal was a great choice for those high school courses.