'CodeSpells' Video Game Teaches Children Java Programming 245
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."
had a similar idea some time ago. (Score:5, 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.
Re:not a complete success (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.
Re:not a complete success (Score:5, 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.
Re:Let me read that again (Score:4, 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.
Re:not a complete success (Score:4, 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. [stackoverflow.com]
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
Re:How about Python or something? (Score:4, 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.