Slashdot Mirror


'CodeSpells' Video Game Teaches Children Java Programming

CyberSlugGump writes "Computer scientists at UC San Diego have developed a 3D first-person video game designed to teach young students Java programming. In CodeSpells, a wizard must help a land of gnomes by writing spells in Java. Simple quests teach main Java components such as conditional and loop statements. Research presented March 8 at the 2013 SIGCSE Technical Symposium indicate that a test group of 40 girls aged 10-12 mastered many programming concepts in just one hour of playing."

44 of 245 comments (clear)

  1. The spell book looks INCREDIBLE: by Osgeld · · Score: 2

    Or like a windows 3.11 ui for an edutainment product that came with the computer...

    whatever, as long as it works

    1. Re:The spell book looks INCREDIBLE: by Fluffeh · · Score: 4, Insightful

      The entire game looks pretty basic - and who the heck cares? Watch a two year old and see what happens when you give em a present. They are as likely to play in the big box as with the toy.

      Graphics might be important for the latest 3D shooter, but a good game doesn't HAVE to have cutting edge graphics. A game with amazing graphics can still be crap.

      If the idea is to teach kids how to code, and they enjoy playing the game enough to at least learn a little coding - then it is a GREAT product. If I was ten and wanted to learn java and had a choice of following tutorials/reading books/etc or playing a game that taught me the concepts, then I certainly know how I would have learned java. Sure, all my projectst might also include a random "Save the GNOMES!!" routine, but you know..

      --
      Moved to http://soylentnews.org/. You are invited to join us too!
    2. Re:The spell book looks INCREDIBLE: by McFadden · · Score: 2

      I got almost my entire introduction to programming in a C-like language through being a Wizard on an LP-Mud back in my student days in London. And that had no graphical UI at all - just text only. Until that point I had no prior programming experience, but it taught me the fundamentals that have now served me for over 20 years as a developer.

    3. Re:The spell book looks INCREDIBLE: by LordLimecat · · Score: 2, Insightful

      The entire game looks pretty basic - and who the heck cares? Watch a two year old and see what happens when you give em a present.

      Polish can be incredibly important. If first impressions are bad, the student may not get hooked, which defeats the entire point of packaging the thing like a game.

    4. Re:The spell book looks INCREDIBLE: by Cryacin · · Score: 2

      Polish? Why do you want to outsource this to Poland already?

      --
      Science advances one funeral at a time- Max Planck
    5. Re:The spell book looks INCREDIBLE: by qwak23 · · Score: 2

      Because they brought us "The Witcher" and we'd really like to see what else the Polish people are capable of?

    6. Re:The spell book looks INCREDIBLE: by seeker_1us · · Score: 2

      Something can be basic and polished. This doesn't look unpolished.

  2. not a complete success by Anonymous Coward · · Score: 4, Funny

    38 of the 40 girls in the test group complained that, once they were written in Java, the spells took forever to execute.

    1. Re:not a complete success by Anonymous Coward · · Score: 4, Informative

      Your joke was funny 15 years ago when Java was actually slow.

    2. Re:not a complete success by MrEricSir · · Score: 2

      The bigger problem is that once students exit the game, their memory gets garbage collected and they have no recollection of what they learned.

      --
      There's no -1 for "I don't get it."
    3. Re:not a complete success by mark-t · · Score: 3, Insightful

      I've seen java programs actually run *faster* than native code under certain circumstances. In particular, object allocation with the 'new' keyword in Java is often far faster than dynamic allocation with the 'new' keyword in C++, even when you factor in the costs of garbage collection compared to manually invoking delete in C++.

    4. Re:not a complete success by Anonymous Coward · · Score: 3, Interesting

      I really can't tell if you're trolling. If you're not trolling then you should know that the reason heap allocation is faster in Java is because Java allocates a sizeable chunk of the systems memory on runtime startup to use as a pool allocator. In C++ you're expected to come up with your own allocation strategies because you know more than the compiler about what the high level behavior should be. What you were actually benchmarking was the overhead of the system calls/context switches that come with operator new versus just grabbing the next page in a pool. If you were to use a simple pool allocator in C++ as well, it would smoke Java as expected.

      Incidentally, this is the reason I started blacklisting the Java runtime on my machines: it used to render one of my older systems unusable because it would allocate a significant fraction of system memory if it was allowed to come up. Because it was a low-memory machine, occupying such a huge chunk of memory made it extremely easy to cause the machine to thrash if anything else were to run as well.

    5. Re:not a complete success by McFadden · · Score: 2

      38 of the 40 girls in the test group complained that, once they were written in Java, the spells took forever to execute.

      Probably ran slow because their machines had been compromised by 5 separate zero-day exploits before they'd finished the lesson.

    6. Re:not a complete success by Kagato · · Score: 4, Interesting

      Yeah, that's fairly outdated thinking. Speed isn't derived by the language anymore. It's the execution that counts. Java Compiles down to op-code, which is run in the JVM. The JVM has decades worth of run-time optimizations. The majority of large scale web sites are written in Java.

      Hey, ever heard of Hadoop. You know the large scale Map-reduce framework based on Google's technology that sorts terabyte and petabyte of data? Java.

    7. Re:not a complete success by b4dc0d3r · · Score: 3, Interesting

      When Java first took off, and the web was made of Java content executed via plugin, Java was written by idiots who concatenated strings instead of using string builders, and similar abuses of common sense through ignorance and teaching materials that focused on results rather than good practice. Executables outside of plugins suffered the same deficiencies, although they were probably attempting loftier goals, and the performance was... what is the opposite of magnified, because it was slower than a sloth taking a crap?

      This lasted a number of years, even as the Java interpreter became stable and work was made to increase its performance. Idiot coders learned or abandoned Java, and the runtime made even the remaining idiots look better, if not "good".

      If you don't find this comment amusing, you either lack historical perspective, are a Java programmer, or should consult a medical professional to be diagnosed for your deficiency in some manner or other.

      Security problems these days seem to be focused on the browser plugin, rather than locally executing native apps, so the security comments mostly don't apply. Visiting a random internet web page and allowing it to execute poorly sand-boxed arbitrary code is a bit like licking random strangers' genitals. In case that interests you, let me state that it should not be done as a general practice, and you should consult a medical professional.

      I have read Java for over a decade, and I have coded in Java for 3 years or so. Having experience with x86 ASM (AT&T and MASM), K&R C, ANSI C, GWBasic, Turbo Pascal, C++ (VC 5-2010, gcc 2.x - 3.x, mingw), VB 5-6, C#, VB.NET, Python, Powershell, JavaScript (advanced, not your normal getElementById().Blink() shit) and several other introductions, I can say this:

      Java examples in the real world and in most printed books are the most incestuous, groupthink-y, overly-architected piles of verbosity I have ever had the displeasure to read. I completely understand the need for default parameters, dependency injection, constructor and method chaining, and all kinds of modern best practice.

      But I have never seen another language embrace the overbearance of best practice teachings without implementing some balance of solution soundness. Java examples and implementations (open source of course, because I have read them) seem to abound with overloaded methods under 5 lines of code, which initialize another parameter to call another overload. Now you have multiple functions to unit test, multiple code paths, multiple exception sources, and unless you are brainwashed in the spirit of Java, comprehension of the complete workings are complicated by scrolling off-screen with essentially purpose-free function declarations, whitespace between functions, and an essentially functional programming paradigm split over several different methods to give the appearance of flexibility, OOP, and conscious design.

      It reads to me like someone wrote that no method should ever take more than one additional parameter that you were not already given, and coherence be damned. I would much rather see a single method with 5 non-optional parameters than 5 overloads which calculate and pass one new parameter each time.

      The Java paradigm seems to be calculating things within the overloaded methods is preferable to factoring out these into unrelated functions. In a truly sane, OOP world, those calculations would be a part of the object, or if sufficiently general would be part of the object's base object.

      In fact, the Java approach seems to be the Builder design pattern, which I have not seen adopted as frequently as it should be. Obligatory link here.

      As sensible as the Builder pattern seems to be, I think it would still require a number of extra Set/Get property methods, which are function calls. Maybe Java has optimized this, but if you don't adopt it optimization can't he

    8. Re:not a complete success by gbjbaanb · · Score: 2

      yes, I've heard of Hadoop - the framework that fixes java performance by splitting its execution up across a couple hundred machines. :-)

      The framework language isn''t the performance part though - it just acts as a manager to send data to a group of workers and aggregate the results back, its the workers that are important. If they are slow, the whole thing is slow. So its best to write these in a native language. Its not anything special to Java either - Google's mapreduce implementation is written in python

      If you want a good map/reduce language, forget Java and go with Erlang which is much more suited for this type of programming.

  3. Re:How about Python or something? by spike+hay · · Score: 2

    Over half of the population is way too dumb to understand programming in the first place. It's better to start off with a good language.

    Also, C is easier than Java. C++ maybe not, but then it sucks balls too.

    --
    If you don't understand any of my sayings, come to me in private and I shall take you in my German mouth.
  4. Re:Code Hero by MrEricSir · · Score: 2

    Let's compare the two, shall we?

    CodeSpells actually exists and is backed by a university. Code Hero shows no signs of ever being completed and is backed by a guy who's notorious for scamming people.

    --
    There's no -1 for "I don't get it."
  5. had a similar idea some time ago. by wierd_w · · Score: 4, Interesting

    I had a similar idea some time ago, but with an MMORPG setting.

    One of the issues that has always rankled me hard was the "cookie cutter" nature of the world events in those games, as well as the limiting gameplay options, so I had this idea for "obfuscated and sigilized" programming syntax as the basis for a game's magic system. Rather than presenting a loop as a nested block of instructions, it would depict it as a "container", with subcomponents inside. Kind of a mix of flowcharting and stylized syntax.

    The idea was that the layout of the "enchantment" could be moved and teased to make clever images out of the interconnected containers and symbolic representations, to make the programmatical nature of the system less banal, and much more aesthetically attractive, while simultanously making the kinds of magic and counter magic highly diverse and dynamic.

    I never really did much with the idea (ideas aren't worth much, despite what the USPTO and several shell corps may claim. Implementations are far more valuable.), and all the "on paper" mental models I tried kept having non-trivial problems.

    I like seeing that somebody had a similar idea, and made a working implementation.

    1. Re:had a similar idea some time ago. by exploder · · Score: 3, Funny

      Battlegrounds in World of Warcraft were kind of awesome back before they (quite correctly, I guess) put all sorts of restrictions on what kinds of things could be scripted. I used to *own* the level-19 battlegrounds with a warlock and an addon I wrote to keep track of enemy targets and optimally distribute my various curses and afflictions. I just ran around mashing the spacebar like crazy, because among the few restrictions was that every action had to be tied to a hardware event.

      I also earned 10,000 gold in the auction house with another addon of mine that helped me find and relist underpriced stuff. At that time, 10K gold was an eye-wateringly large sum. It's probably pocket change now...I've been out five years.

      Man, I really did feel like a wizard with arcane and hidden knowledge. It was great. I've often wished for a game where programming was the way you do magic, but only that once have I gotten it. I guess a key part of the experience was that hardly anyone else could do it, or knew how I was doing it, which is how magic is often imagined to be.

      --
      Yo dawg, I heard you like the Ackermann function, so OH GOD OH GOD OH GOD
  6. Re:How about Python or something? by Anonymous Coward · · Score: 3, Insightful

    Pointers really are complicated for anyone IQ 110 or below. Most people who attempt CS weed out classes are above average, but half struggle with pointers.

  7. Re:How about Python or something? by xero314 · · Score: 2

    That's elitist bullshit. 90% of the population of the world could easily learn to program and learn to do it proficiently. If we taught binary and boolean logic earlier in life, programing would be second nature. And yes I interview crapy engineers regularly. It's not lack of capability holding them back, but rather piss poor education.

  8. Re:Doomed by Anonymous Coward · · Score: 3, Funny

    That's why Java has builtin garbage collection, DUH!

  9. kturtle & minecraft vs codespell by Ragica · · Score: 2

    My nearly six-year-old is doing great things (for a kindergartner) with KTurtle -- which is really a pretty cool environment (I was surprised to find). He also spends much time hacking crazy stuff with redstone in Minecraft. The next logical step to real programming language seems to me, keeping it fun and relevant to his interests, is to introduce some javascript (as much as I dislike it) so he can mess up web pages with little effort. From there it seems python is the friendliest, easiest and most resource-rich multi-purpose playground.

    Maybe CodeSpell will be something to check out eventually. Though the java example on their blog doesn't look all that fun to me. I hope its fun. If it gets to the point where I'm teaching the kid OOP, and all the verbose java syntax requirements, he'll probably only want to make minecraft mods. That's what CodeSpell is up against in this house.

  10. Re:Let me read that again by Anonymous Coward · · Score: 5, Insightful

    Yeah, you go ahead and explain loops and conditional statements to 40 10-year-olds. They'll learn it in 5, master it in 10, forget all about it in 15. They'll probably be bored, too.

    Or you can use a software like this which will engage them, encourage them, and help them remember it when they go home that night. It sure would be a shame if they were excited to learn more the next day and had a platform that was there to teach them and give you time to grade their math tests.

  11. Re:How about Python or something? by spike+hay · · Score: 2

    Yeah, you interview crappy >. Try talking to liberal arts students or people who have not gone to college.

    --
    If you don't understand any of my sayings, come to me in private and I shall take you in my German mouth.
  12. Re:How about Python or something? by xero314 · · Score: 3, Insightful

    Gee, when you talk to people that never learned programming they know nothing about programming. If you are having trouble explaining it then the problem might not be on their side.

  13. Re:How about Python or something? by jrumney · · Score: 3, Insightful

    Also, C is easier than Java.

    Perhaps to someone who has been trained in C but not Java. The biggest problems with C when compared against Java is the limited extent of its standard library, sorting through the plethora of poorly documented non-standard libraries that are available (vs Java, where if there isn't a standard for it, then the next obvious stop is apache.org) and the fact that you need to understand the hardware architecture of the system you are developing for in a lot of cases, as well as distinctions between stack and heap and a bunch of low level gotchas in the language that are far from obvious to the newbie, or even to experienced developers sometimes.

  14. Re:How about Python or something? by Anonymous Coward · · Score: 2, Funny

    Also, you said "your" instead of "you're"; if you are confused by this, these words are used correctly here: "you're a moron, your opinion doesn't count."

  15. Re:How about Python or something? by cduffy · · Score: 2

    The author of python even stated that he designed python for web hacking

    I'll have to ask you to back that up. Python 1.0 is from 1994, and didn't have much by way of specialized facilities for this purpose. Sure you aren't thinking of PHP?

    Anyhow, if you care about "type systems and formalism", you should be on Haskell; Java is distinctly half-assed. (Type-erasure generics? Really?!)

  16. Re:Let me read that again by qwak23 · · Score: 3, Interesting

    I wish I had mod points right now.

    One of the best things I ever had as a kid was a TRS-80 (CoCo - and not a true TRS-80 either, even though that was stamped on it) that booted to a BASIC interpreter. The code for any games I loaded directly off disk could be tinkered with easily, no need to compile. This was awesome as a curious 5 year old.

    Even better about it were the games "Rocky's Boots" and "Robot Odyssey". These games taught me the basics of digital electronics, lessons which have actually helped in my current career as a technician (with no formal training in digital logic). Seeing this kind of software being produced in a modern setting is awesome, I wish there was more of it.

  17. Re:Neal Stephenson bet them to it by qwak23 · · Score: 2

    There have been games that have done this before, even well before "The Diamond Age" was an idea in Stephenson's head. The problem is these kinds of games are so few and far between that it's fairly notable when one comes up.

    While I certainly played my fair share of standard games as a kid, I also had quite a few educational ones as well (granted some of them were below me, my parents bought me a math game based on my age and not my ability). As much as I hate coding now (mostly due to syntax crap in languages like Java), I love the logic behind it and the games I had that involved various forms of programming to solve problems were always a lot of fun.

  18. Re: How about Python or something? by Anonymous Coward · · Score: 5, Informative

    The reason that Java isn't as fun to program is the same reason that it's good for businesses. The language is very restrictive and prescriptive of how you should do things. For programmers that want flexibility and power, the constraints and extra typing (dual-meaning intended) chafe. But when you're using it as part of a large group, those same constraints become the things you can depend on. Where is a certain class located? Java requires it to be in a certain directory. What methods are available on a class? Java's static type system was designed to make tooling easy, so your IDE will tell you. And even talented programmers can mess up manual memory management...the less-talented wouldn't stand a chance without Java's memory management. The list of things that Java prevents you from screwing up is quite long.

    Basically, for my home coding projects and projects where I work with a small team of talented developers, Java is one of my last choices. But for my boring 9-5 job where I'm working with 30 knuckle-draggers who don't understand the purpose of an interface, let alone how to write functional code that's easy to read, I want them writing Java and I'm willing to pay the Java price to get that.

  19. Re:How about Python or something? by Samantha+Wright · · Score: 2

    While the mods may not agree with you very strongly, I've seen a wealth of evidence that says Java is a bad introductory language. The CS department at my alma mater switched from an all-Java curriculum to one with a Python intro, and the student attrition rate dropped by a significant margin. A friend of mine—the daughter of two CS profs—was dead-set on avoiding programming as a teenager until I introduced her to languages other than Java.

    While the formalisms and syntax are great for software engineers writing reusable and interoperable code, they're a serious blight to beginning programmers. The practice of teaching nothing but Java is probably more responsible for the post-dotcom drop in enrolment than the actual tech sector recession. Children should be taught something with a simple, easy-to-understand operating model like BASIC, Turing, or Pascal. It's frustrating to think about how much work went into programmer education in the sixties, seventies, and eighties, and how it's all been thrown away just because the languages at hand were obsolete.

    --
    Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  20. Re:How about Python or something? by Samantha+Wright · · Score: 3, Interesting

    Irony of ironies, C# is almost exactly like Java at the language level, only with a totally different object hierarchy, which is why it's easier for UI development. The .NET hierarchy is somewhat influenced by classic VB, which was a very well-developed and efficient (if sometimes limiting) format for expressing common UI needs.

    Java's popularity, sadly, has to do exactly with that OOP evangelism. In the late eighties and early nineties, academic software engineers were absolutely convinced OOP was the silver-bullet software development paradigm for all ills, since encapsulation (hiding methods) made code re-use practical. They also believed it was the end to all programming practices that inhibited re-use, particularly global variables. Unfortunately they made the mistake of conflating these practices with "laziness," and very mistakenly believed in a bizarrely Victorian fashion that all beginners should be forced to use only best practices, as though we should be teaching infants proper manners straight out of the crib.

    It's stupid enough that I sometimes wonder if it was a massive conspiracy by Sun's marketing department, but to be honest computing has always been full of fads like this. In the early eighties, logic programming was The Way Of The Future; everyone thought that Prolog and constraint-satisfaction-based expert systems (basically, fancy predicate logic expression solvers) would dominate computing for the rest of time. Today, there are only a few niches where new Prolog code is considered desirable.

    --
    Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  21. Re:How about Python or something? by Samantha+Wright · · Score: 2

    Just like in math, CS is riddled with context-specific names for refinements of the same thing. You wouldn't want to conflate a ring with a field, right? For what it's worth, though, the first OOP language, Simula, just called them "procedures" at the syntax level. And in the case of encapsulation, there really isn't a good, compact term for "writing all of your code properly so that nothing inappropriate is publicly accessible," so that was kind of a new concept that needed a new name.

    But for what it's worth, I'm not a fan of OOP terminology either, and cringe whenever a Java-educated programmer uses the word "method" to describe any old subroutine. I assume there were structured programming advocates back in the early eighties who got annoyed when C programmers started calling everything "functions," even when they didn't have return values.

    --
    Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  22. Re: How about Python or something? by phantomfive · · Score: 3

    In other words, "Java is for other people." I feel the same way: I used to hate Java, but now I respect it for the reasons you just described.

    --
    "First they came for the slanderers and i said nothing."
  23. Re:How about Python or something? by qwak23 · · Score: 4, Insightful

    At the elementary level I don't think the choice of language with reference to the business environment is that important. Teaching kids that they can make their computer/tablet/whatever DO STUFF and presenting it in an easy to digest format is much more valuable that what is big in the industry now. Keep in mind, elementary age... at least 20 years (on average) until they start rolling to the job market. Not all of them will be programmers. The languages we use now may be dying by that point. they may not all be programmers, some may be scientists using more focused languages in the vein of Matlab, some may be homemakers, some may be athletes, some may be artists. But they will all have an appreciation for technology and what it can do. They will all get introduced to logic and algorithmic structure at a much earlier age than is normal right now. Those things easily apply to other aspects of life. Hell, if they keep at programming strictly on a hobby basis, they may even catch on to when the developers at their company/organization/whatever are BS'ing them about what can and cannot be accomplished.

  24. Re:How about Python or something? by jkflying · · Score: 2

    This is 2013, we shouldn't have to indent manually still. If you want to cut/paste a few lines of of code from one section to another, if the indentation doesn't match it can be seriously annoying in python to get it all correct. Compare this to java, where as long as it is between the curly brackets I know it will be OK. Press the shortcut for auto-indent, and I can tell immediately if it is in the right place.

    --
    Help I am stuck in a signature factory!
  25. Lua with Minecraft + Tekkit mod by uberbrainchild · · Score: 3, Informative

    Try tekkit for minecraft, it will give you a mod called computercraft which will allow you to place computers with consoles on the map and even hook up wireless modems and a disk drive to them. Using lua you can then program these computers to do whatever you want basically, me and my brother made 3 train stations which would handle carts and track switches with the computers. You can even program "bots" with lua and have them build structures and whatnot. They can even defend your area if you want. All this is done with lua inside the minecraft game. You can of course import larger scripts from outside the game since typing them in the console minecraft provides can take a while.

    --
    Anveto
  26. Re:How about Python or something? by Hentes · · Score: 2

    In C, you don't have to create a separate namespace with specifically named folders and files, and a separate class just to be able to say "hello world". Kids lose interest very quickly if they don't get results, having to learn about OOP before they write their first program isn't going to work.

  27. I feel... by HaZardman27 · · Score: 3, Funny

    I feel like my signature is very relevant today.

    --
    Apparently wizard is not a legitimate career path, so I chose programmer instead.
  28. Re:How about Python or something? by pla · · Score: 2

    That's elitist bullshit.

    The world could use more elitism, instead of dumbing kids down by teaching them that we should value mediocrity. Everyone gets a trophy, woo-hoo! But a job? Gee, kid - Sorry we didn't prepare you to actually compete when you get to the real world...


    90% of the population of the world could easily learn to program and learn to do it proficiently.

    Aahahahahaha... Oh, man, stop, ya killin' me here!

    With a lot of effort, you could teach most people to use cookie-cutter VBS snippets in Excel. But programming? No. Most people not only can't program, they outright loathe the mental state programmers need to enter and stay in for hours at a time. When I describe my job (in the abstract, not talking about one specific project or domain) to most people, they cringe.


    And yes I interview crapy engineers regularly.

    Not really supporting your own point here - A solid C- student who managed to graduate with a STEM degree still blows the doors off the rest of society for their ability to think logically and break seemingly-intractable problems down into tiny easily-solved ones... If the flawed gemstones don't impress you, you might not want to generalize about the actual dross.

  29. Re:How about Python or something? by Hognoxious · · Score: 2

    I learnt about pointers myself when I was a kid.

    Me too, but they were called PEEK and POKE then.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."