Hacker News new | ask | show | jobs
UCSD Computer Scientists Develop Video Game that Teaches How to Program in Java (jacobsschool.ucsd.edu)
72 points by dsinha 4813 days ago
13 comments

This is outstanding!! Man, I would've loved to have this when I was in grade school. I remember being very excited about my one hour per week in front of the LOGO turtle. This goes way beyond. I'm not a big fan of java, but learning how to program in the same language your parents may be using at grown up work is pretty damn awesome.
The game feeling looks like more a modern LOGO game than a World of Warcraft game. The quest seems to be about moving a stone from A to B. It does not seems the player will become more and more powerfull while he grows its own library. It will be so fun to craft its set of functions ang go cast it in some PVP events. Maybe the Notch's new game (http://0x10c.com) will provide this king of "Master of Hackers" feeling.
A really nice idea ... but why, oh why did they have to choose a language that has a lot of extra scaffolding like Java instead of something simpler like Python, or Ruby?
I'm guessing it's because "CSE 8A. Introduction to Computer Science" at UCSD is taught in Java.

A lot of universities start their CS students off with Java these days.

I've seen this in a couple places, but I'm not sure I understand why. Does anybody know of a good reason for teaching java first?
There are a few big reasons schools still teach Java primarily - adoption, scalability, and maturity. According to almost every Tiobe language survey, Java has been and is still either #1 or #2. It is pervasive in just about every enterprise IT environment throughout the entire world (whether you realize it or not), running on a ~billion devices and, now, Android phones as well.

Furthermore, it has very mature support for everything from GUIs (Swing) to web development (Servlet) to high-powered concurrency to advanced data structures. There are literally thousands of libraries and frameworks for every need and a wealth of talent and knowledge out there. Its performance is also orders of magnitude better than interpreted languages like PHP, Python or Ruby. It simply scales better in just about every way and is universally supported almost everywhere.

So, to summarize, for all the reasons listed above Java is the bread and butter of enterprise software. Personally, I prefer Python and C#, but Java is unavoidable if you want a good paying job or are serious about building a high-performance, platform-independent, scalable application.

Yes, but teaching java before graduation is different than teaching it first. You can get all the benefits you mentioned of learning Java even if it's the second or third language while using something nicer for the first one (python? Scheme? SML?).
Not so. Learning on an interpreted language is akin to learning how to fly a plane by simply riding in one. There is a lot to learn in a CS program, and it really requires a single language from start to finish. Python doesn't have some of the advanced capabilities and adoption of an enterprise-class language like Java. Believe me, I love Python - I've created a ton of apps with it, but I also have a CS degree and have seen the practicality of using a single language from start to finish.

How are you going to reinforce the notion of how a compiler works with an interpreted language? How would you teach and force the use of static types on a dynamically typed language? How would you teach true concurrency and thread safety with a language that is limited by a global interpreter lock (GIL)? These are introductory things a CS student would take in their first year.

Universities in the US don't teach languages in general. At my school, you get 1 semester of Java and that's it. The next class people take that uses something else is compilers, and that uses C. You're just expected to know it.

The usual justification is "we're not a vocational college" which I think is kind of bullshit.

Class is short, you get one shot. Scheme or Java, not both.
Is seems quite practical to each one of the most used languages in the world. You can then go and pick almost any other language.
The AP (Advanced Placement Exam)^ is taught in Java. Before it was in Java it was in C++. A lot of schools had C++ intro courses because of this. When the AP switched most switched to Java. It isn't the right language in my opinion for an intro course but there you go.

^ an exam which offers college credit at most universities to high school students

I feel it gives a good tradeoff between:

- typed languages that are too low level to start (C/C++)

- scripting languages that are high level, not typed, and therefore do a lot of things under the hood (Python, Ruby, Javascript)

This is a reasonable view, but I want to point out that Python and Ruby are strictly typed, just not statically typed. You must still understand primitive types and casting, in contrast to JavaScript or PHP, which are both loosely and dynamically typed (a frequently dangerous combination).
It's in the interest of the big companies. From what I know, some smaller schools like Harvey Mudd start off with other languages, like Scheme and Prolog.
That used to be The Way To Do It(tm).

MIT switched away, though to python iirc which isn't terrible. Northeastern still uses Scheme first though.

IIRC, Harvey Mudd starts off with Python, in the intro class everyone takes. I just looked through their course listing, but I'm not 100% sure I'm thinking of the right class.
Why not?
There it is. I wondered how far I'd have to read before we had a Java hate comment. Never fails.
It`s not a Java hate comment: I'm writing this as an educator with 20 years teaching experience who has learned that some languages are better teaching ones than others. Java has its place ... but another language would be better suited there.
Perhaps their next project will be a game that teaches kids how to smoke.
Java is a great choice for CS. It's similarity to C/C++ is handy for those who need to transition high performance computing or move to work on low level systems (kernels, drivers, embedded systems, etc). The JVM is also a great target for learning about virtual machines, since the JVM itself is quite an amazing virtual machine by it's own regard. The JVM can also be used to study a 'real life' implementation of stack machines, and Java bytecode can be used as a [gentler] introduction to assembly.

So yes, while you're startup may choose Python or Ruby or the latest language of the day, Java is a great system to teach a lot of fundamental computer science topics with.

Besides, Google uses it.

So yes, while you're startup may choose Python or Ruby or the latest language of the day, Java is a great system to teach a lot of fundamental computer science topics with.

Are you implying that Python (1991) and Ruby (1995) are some sort of flavor of the day compared to Java (1995)? :-)

    import java.util.LinkedList;
    import java.util.List;

    public class Pets {
        private List<String> pets;
        
        public Pets() {
            this.pets = new LinkedList<String>();
            this.pets.add("cat");
            this.pets.add("dog");
            this.pets.add("bird");
        }
    }
or whatever may be great for transitioning people to C++ later on (not exactly where all the jobs are...), but

    pets = ["cat", "dog", "bird"]
is probably a gentler introduction for elementary school students.
List<String> pets = Arrays.asList("cat", "dog", "bird");

You were saying?

> List<String> pets = Arrays.asList("cat", "dog", "bird");

Yeah...

This is a language that has its (very large) niche... education is not in that niche. Not out of merit anyway.

It's telling that you feel that is actually a counter example.
C++ comes in second behind java in terms of jobs according to stats from indeed: http://www.indeed.com/jobtrends?q=java%2C+C%2B%2B%2C+C%23%2C... . It might not be the new hotness, but there's still plenty of work for C and C++ programmers.
The point is not jobs, the point is going from zero to coding without scaring too many people off.
Gentler for a weekend hacker, but not for a student. Java is verbose for a reason - safety and reliability. Things enterprises value.

Students need to learn what is most pervasive in the field they plan to enter. That being Java. Starting them out on a "lite" version of a programming language simply because it is easier is just setting them up for failure.

I don't agree with the Java hate (why not teach kids to use Java? it's rather condescending if you think they can't learn it), but I will say: having learned to program on my own, I found it both easy and rewarding (lots of immediate, rapid growth and feedback) learning with Python for a few weeks before getting into Java. For some people, and maybe kids are NOT this group (but the group exists), the initial syntax barrier for the complete novice is much more intimidating in Java than it is in Python (or Ruby). I mean, arguably even C has an easier-to-grok-for-the-total-noob 'Hello, World!' than Java...

[insert examples of runnable 'Hello, World!' and 'Hello, <name>!' programs in Python v Ruby v Java here]

Thus, anyone who learns a first language other than Java is setting himself up for failure?

My first language was Basic on an Atari 800. My second was C++. I've made a respectable career from programming since then, in both serious and "lite" languages alike, including Java. I seem to have avoided these dire consequences. :-)

List<String> pets = Arrays.asList("cat", "dot, "bird");

Bad usage does not equal bad language.

This is aimed at elementary and high school students, not at CS students. Java may be an acceptable choice for introduction to programming in CS programs, but that is not the purpose of that software which aims to introduce programming, not computer science.
CS _is_ programming. Just more in-depth.
> CS _is_ programming. Just more in-depth.

CS to Software Engineering to Programming is as Physics to Aerospace Engineering to Aircraft Maintenance

Related, but not the same thing.

UCSD + Java = a love affair we may never be able to disrupt
This whole thread about their use of Java completely misses the point of this project. Maybe people shouldn't be so hung-up about what language is being learnt? I'm sure the students will be learning a whole range of languages.
Right before opening this page I knew this type of comment was going to be one of the top comments and was not disappointed. Why oh why can't the whining stop?
There's a lot to complain about with Java, but one part that IS great is that applications generally port pretty easily between environments (everywhere interesting for consumer software except iOS). Also this depends on Unity3d... guess what else is multi-platform! (including Win/OSX/Linux/web/iOS/Android)

I trust, then, that there's a good reason why this claims to be dependant on OSX. Seems to have something to do with this June (Java in Unity) thing.

This is a great idea. The feeling of being able to do anything combined with reasonable limitations (ideally invisible) to focus the player's energy is extremely engaging--perfect for teaching.

And I've always thought of magic spells in fantasy as a kind of hack using a secret, natural programming language. :-)

So, I just tried this out. I think it would be a lot more user friendly if you could see what "spells" are available when making a new spell (i.e. have auto completion in the text editor). It's a pain to have to look at the spell book, and limits experimentation.
This used to be called Robocode back in the day.
I came here to mention Robocode. I played the hell out of that back in the day. I am currently working on an indie game (RTS) that includes AI in singleplayer mode, and also allows you to program your own AIs by making a class that inherits from my abstract AI class which gives you access to an AI API. With Robocode there is a pretty high barrier to entry, but my goal is to have the game be entirely playable and a fun game, which then entices the user to go mess with the AI code.
For Mac OSX 10.5 and Above.

I will have to check this out when I get access to a Mac that I can install it on. I loved the vim game at vim-adventures.com

If you haven't heard about Greenfoot, it's a project with similar idea. http://www.greenfoot.org
It's not about easiness --learning to code is probably simpler than learning to play such a game.

It's a about motivation.

Code Spells? Sheesh, sounds a _lot_ like Land of Lisp, but done with Java. Wonder what Conrad Barski thinks of this.
I'm trying to envision the MMO version of this, with special reference to (dungeon) raids.

"Leroy, you'll levitate the troll for 15 iterations. Zelda, you'll comment out the basilisk. Everybody, now's the time to warm up your caches. Ready check ... OK then. 0, 1, 2, 3 ... Go go go!!"

I wonder if you could write an extension to an existing game/mmo to use the same code-as-spell system.
super cool!