Friday, June 24, 2011

Gripes and Complaints

In just under a week, assuming all goes well, I'll be launching a version of Creatures & Castles on the Chrome Web Store.

For me, this was very much a learning experience. And as part of that learning experience, I can report that HTML5 in combination with JavaScript is very very close to being ready for primetime.

Almost, but not quite... As far as canvas support goes, Google Chrome, IE9, Safari and Firefox 4 all seem to have the bases covered. I ran into no significant cross-platform issues. Performance was more than acceptable - especially on Windows - even though I was making fairly heavy use of alpha blending. It's a shame that Mac Chrome doesn't offer hardware acceleration on the Canvas.

The biggest hindrance to the development of the game was JavaScript itself. Being more used to strongly typed languages that enforce data types, program structure and variable names, the freedom offered by JavaScript is more than enough rope to hang yourself with; for Creatures & Castles I was fortunate in that I had a version of the game written in a strongly typed language to as a template. Apart from that, I'd have to say that if the web version of the game has a class hierarchy, it is enforced only in my head.

There are tools such as Monkey that provide a more structured language (and can export to a number of target platforms including HTML5). I did not have time to test this tool, but the results look quite promising. I suspect it will be more useful as a prototyping tool than anything else. However given the pedigree behind it, I wouldn't be unduly surprised to see it used for more.

What Is really needed is for JavaScript to be given an industrial strength overhaul to add true object orientation, type safety and polymorphism. Personally, I would love to see something based on C# used as a JavaScript replacement, but I don't think I'm likely to be seeing that any time soon.

6 comments:

Andrew Rabon said...

Glad to hear it's coming to the Web Store!

Trying to ram object orientation down JavaScript's throat will not work very well. JavaScript isn't, nor should it, model itself after strongly-typed, object-oriented languages. To truly see what JavaScript is good at, I'd pick up JavaScript: The Good Parts by Doug Crockford.

Unknown said...

Agreed. There are some nice attempts to improve Javascript, but, honestly, I'd like to see C# adopted as a first class browser scripting language. It'll never happen though.

Andrew Rabon said...

C# is nice, and probably my favorite compiled language. I wouldn't say C# necessarily since it really is kind of a Microsoft thing (Mono is *still* lame compared to the MS version.)

You should check out CoffeeScript, which may become a candidate for the next browser scripting language, used alongside JS. It's sort of like Python, I hear at least, and does things to improve the core language.

Unknown said...

Coffeescript, huh? I'll take a look... Google have something along those lines I believe; Closure, I think it's called.

Calydon said...

Why will C# never be adopted as a first class browser scripting language? Isn't it already used mostly with Aspx?

Unknown said...

I was thinking more on the client side. However, Google's Dart language is also looking pretty nice.