News for hackers. Stuff that matters.
Re:On the making of a girl nerd by macavity23 on Friday April 13, 2012 @09:21AM (#3836558)
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.
Re:On the making of a girl nerd by tantalor on Friday April 13, 2012 @09:48AM (#3836670)
The College Board Advanced Placement exam for Computer Science has used Java for several years now.

See 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.

Re:On the making of a girl nerd by eli on Friday April 13, 2012 @09:50AM (#3836682)
Prior to that it was C++. I think they're actually moving in the right direction.
Re:On the making of a girl nerd by gaius on Friday April 13, 2012 @10:06AM (#3836750)
Compare 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.
Re:On the making of a girl nerd by Jach on Friday April 13, 2012 @10:31AM (#3836876)
I 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.
Re:On the making of a girl nerd by Turing_Machine on Friday April 13, 2012 @11:14AM (#3837083)
In 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.

Re:On the making of a girl nerd by Jach on Friday April 13, 2012 @11:40AM (#3837229)
The necessary HTML dings the number of unique things up so it's not quite that simple. But I like the idea of being able to easily share your creations, I started with PHP and a friend let me FTP files onto a subdomain he set up for me. I remember sharing a "99 bottles of beer" print-out with online friends when I learned about for loops. (I also remember spiking the server load by increasing the number into the billions...) I think a JS oriented programming class has as much merit as a Python one. We can discuss tradeoffs more (e.g. JS's style of OOP is superficially further from Java's than Python's is and AP culture still favors Java/C++ style OOP, which PHP is actually very similar to) but I think they're both better attractors into the field than Java.
Re:On the making of a girl nerd by Turing_Machine on Friday April 13, 2012 @12:25PM (#3837492)
Yep, it's definitely worthy of discussion IMO. Someone else apparently disagrees, since my post got modded down to -1. :-)
Re:On the making of a girl nerd by tantalor on Friday April 13, 2012 @11:39AM (#3837226)
IIRC Code Academy teaches JavaScript with,

console.log("Hello World");

Re:On the making of a girl nerd by _delirium on Friday April 13, 2012 @12:27PM (#3837507)
When I took AP CS in C++, unfortunately, the finer details of iostream took up an inordinate portion of the class, which was particularly useless because iostream is really weird in a lot of ways (e.g. the stateful format specifiers sort of mixed in with the data being output). The part that wasn't taken up by that was taken up by memorizing some STL syntax.

Fortunately I actually taught myself programming in HS by writing mIRC scripts so I could do cool automation stuff in my spare time, and I had learned a little earlier in some kind of Logo course targeted at elementary-age kids. If it were up to that high-school C++ course to get me into computers, though, I would definitely not have done so...

Re:On the making of a girl nerd by sirclueless on Friday April 13, 2012 @10:06AM (#3836754)
The sad part is they can't realistically choose to use python any time soon, because the language is undergoing backwards incompatible changes. Until python 3 is the norm everywhere it's tough to teach to such a moving target.
Re:On the making of a girl nerd by Jach on Friday April 13, 2012 @10:26AM (#3836856)
I don't think this is a true concern. When I took the AP class we used Java 1.4. I'm sure you know how big the differences are between Java 1.4 and Java 1.7. The AP course is about the fundamentals of computer science, the language doesn't matter--it never touched Generics or Ant or anything a modern Java dev needs. But moving to Python allows for alternative curricula that's either pre-requisite or concurrent with the AP class that also uses Python and its abilities and easy-to-get libraries, like PyGame or Flask, to attract people into the field with shiny things.
Re:On the making of a girl nerd by agentgt on Friday April 13, 2012 @10:32AM (#3836891)
And before that it was Pascal.... I know cause I tried to take it after teaching myself Pascal a day before the exam (I new C/C++). I got so caught up in the stupid syntax of the language that think I got a 2 or 3 :(
Re:On the making of a girl nerd by eli on Friday April 13, 2012 @11:35AM (#3837198)
Pascal does indeed have goofy syntax, but it was designed to be a teaching language. I think that makes more sense than C++.
Re:On the making of a girl nerd by snikolov on Friday April 13, 2012 @12:10PM (#3837402)
There is a CS course taught in Java in my high school, but the prerequisite teaches Netlogo, Scheme and Python. Schools teaching APCS should definitely consider having a prerequisite intro course if they have the resources to do so.
Re:On the making of a girl nerd by adestefan on Friday April 13, 2012 @10:29AM (#3836870)
When 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.

Re:On the making of a girl nerd by Symmetry on Friday April 13, 2012 @09:27AM (#3836578)
Its better than C++ at least, which I learned in High School.
Re:On the making of a girl nerd by scott_s on Friday April 13, 2012 @09:41AM (#3836638)
You 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.

Re:On the making of a girl nerd by Symmetry on Friday April 13, 2012 @10:18AM (#3836815)
The problem is that a High School semester is really too short compared to how long it takes to learn C++, C++ is just too big a language. I ended up thinking I knew something about C++, when I really didn't.

And the hello world program for C++ is just as bad as the one for Java, in its own way. You're writing 'cout << "Hello World"' but how long will it be before you teach the students about operator overloading?

Re:On the making of a girl nerd by scott_s on Friday April 13, 2012 @10:21AM (#3836833)
Note that I agree with you, in that I would rather use Python, or even Scheme. But I think language choice accounts for, say, a 5% impact, while the boring stuff (how much the teacher cares, how patient the teacher is, how good they are at explaining concepts, the quality of the projects - standard teaching issues) accounts for the rest.
Re:On the making of a girl nerd by Symmetry on Friday April 13, 2012 @10:33AM (#3836892)
In terms of preparing students for a career in programming I agree with you, the choice of first language doesn't matter much. But if a student is going to take a single semester in High School and never take another programming course, its far better that they end learning to write mediocre Python than bad C++.
Re:On the making of a girl nerd by kingkilr on Friday April 13, 2012 @09:49AM (#3836675)
I 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.
Re:On the making of a girl nerd by scott_s on Friday April 13, 2012 @10:03AM (#3836736)
I looked up those two papers: "Python CS1 as Preparation for C++ CS2": 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 (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++.

Re:On the making of a girl nerd by kingkilr on Friday April 13, 2012 @10:44AM (#3836953)
It's been a while since I looked at the data, but my main source was: http://blip.tv/pycon-us-videos-2009-2010-2011/python-for-cs1... (a talk Bill Punch gave on those papers). I think it goes into more detail on the non-CS majors.
Re:On the making of a girl nerd by scott_s on Friday April 13, 2012 @10:47AM (#3836964)
Thanks, I'll try to listen/watch that later.
Re:On the making of a girl nerd by navs on Friday April 13, 2012 @09:28AM (#3836582)
I'm only 24 and I was learning BASIC in High School, back in Fiji.
Re:On the making of a girl nerd by rollypolly on Friday April 13, 2012 @09:51AM (#3836692)
I 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.
Re:On the making of a girl nerd by tlear on Friday April 13, 2012 @09:59AM (#3836719)
I 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
Re:On the making of a girl nerd by admg on Friday April 13, 2012 @10:14AM (#3836786)
I'm 25 and was using comal in high school, seems to have been a particularly rare language.
Re:On the making of a girl nerd by hbhanu on Friday April 13, 2012 @09:36AM (#3836610)
My 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!
Re:On the making of a girl nerd by mhurron on Friday April 13, 2012 @09:42AM (#3836648)
Why? What is so bad about Java that it makes learning it so bad as a first language or as a introduction to programming?
Re:On the making of a girl nerd by sirclueless on Friday April 13, 2012 @10:03AM (#3836735)
Having 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.

Re:On the making of a girl nerd by UnFleshedOne on Friday April 13, 2012 @11:57AM (#3837331)
I "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...
Re:On the making of a girl nerd by kingkilr on Friday April 13, 2012 @09:46AM (#3836661)
Because 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.
Re:On the making of a girl nerd by thejteam on Friday April 13, 2012 @11:33AM (#3837189)
Too object oriented. I would hate to have to explain what a class is before I explained what a loop or a conditional is. We have to assume people are starting from nothing.

Or like others have said we could hand-wave it away until later.

Re:On the making of a girl nerd by Tichy on Friday April 13, 2012 @10:09AM (#3836770)
It's extremely complicated. The verbosity is not just LongerKeywords, it is endemic.