Blog of Jeff A blog about programming and random other things.

26Apr/09link

NoteMe and Lessons Learned

As displayed in my AIR post before, I was working on my note taking application: NoteMe, but I’ve already been learning too much that stifled my development. Adobe AIR is a great framework, but I’ve also realized how little I know about web encryption/security. I don’t really understand about digital signing and certificates. Unfortunately, certificates cost, which isn’t something I prefer to dish out for a simple test app like this.

noteme_0.1_screenshot_001

Before I get on with the learning experience, here’s the download (and source). As a warning, the source code is a bit disorganized since I was still learning AIR as I developed it.

It still has a relatively crappy interface as well. I hope to rewrite the application entirely, especially the note editor portion using canvas. Currently I’m using iframes, but AIR has a flawed iframe with no undo/redo support. I’m not sure why it was excluded, unless it wasn’t functionality part of webkit.

Furthermore, there is a bigger problem. I’ve come to the conclusion that jQuery isn’t quite the best for developing large javascript-based applications. It’s very nice and concise for the small amount of javascript here and there, but jQuery code isn’t particularly too clear. This seems more due to my fault for not getting in the habit of commenting my javascript files. In addition, jQuery doesn’t provide a clear guideline for developing large-scale javascript applications. The normal Object Oriented programming in javascript is flawed.

function dog(name){
this.name = name;
this.bark = function(){ alert("woof!"); };
}

var snoopy = new dog("Snoopy");
snoopy.bark();
alert(snoopy.name);

This isn’t the most elegant solution when defining classes. The main problem is that methods you define may not always have this equating to the class. This is evident by some jQuery provided functions ($.each, bind, etc.) which alter this in the context of the function. I prefer to avoid this syntax when possible. It’s ugly to program in.

Of course there’s the static class way:

var dogs = {
repos: [],
add: function(dog){
dogs.repos.push(dog);
},
bark: function(){
for(var d in dogs){
d.bark();
}
}
};

dogs.add(new dog("Snoopy"));
dogs.bark();

This still isn’t too pretty. Although it’s better than previously. The main problem is if you need to refactor the static class. All code that calls the static class needs to be renamed, including internal calls (see red, highlighted line).

MooTools, Prototype and other JS frameworks provide class behavior with static-class-style definition. Although this represents the class object (removing the need for internal refactoring like regular static classes.

As much as I love jQuery, I may have to look into other frameworks when developing a larger javascript powered application that doesn’t have a few ajax or visual effects. Or I’ll plow through my hatred of function-class definitions. Trying something that generates javascript entirely doesn’t seem like a bad idea either.

  • Share/Bookmark
19Apr/09link

Braid

I intended to release an early alpha version of my note me application as mentioned, but tackling my Comp Org Lab (and learning the course material :P ) turned out to be a lot lengthier than expected. For now, I’ll be talking about the indie game: Braid.

For people that like puzzle games I recommend you check out, Braid. The simplest way to describe this game is super mario plus time manipulation.

At any point in the game, you can travel backwards in time. Besides being handy when you get killed, Braid adds additional twists to the “rewind” mechanism which varies per world. One such is alternative dimensions: when you rewind, the world you rewinded from is played is a parallel reality. Certain objects / enemies can be immune to these usual effects, including time traveling backwards.

If a picture is worth a thousand words, how about a video?

Like the mario games, the story line is more of a backburner to the gameplay. Although then ending does have an interesting subtle ending. Maybe it was blatant: I’m not as invested in a story consisting mostly of optional text to read before each world. I only picked up the intended meaning of the ending by playing it through a second time.

The full game consists of 6 unique worlds which accounts to approximately 3-5 hours of game play (if you’re decent at solving puzzles). Each world is broken into rooms, if you can call them that, all of which are unique. Except for one room, but one of the game’s twists makes it feel completely new. Each world provides a new game mechanic that starts easy, to grasp the concept, to thought-stumping puzzles near the latter of the world.

The game feels incredibly well polished, as I couldn’t find any visual anomalies or gameplay bugs. The graphics and effects are rich in detail unlike most indie games. Although replay-ability is limited to speed runs and restarting the game (which means removing all your previous play throughs), but definitely worth the $15.

If you’re not sure if puzzle games are your thing, you can always grab the demo (links to steam).

  • Share/Bookmark
13Apr/09link

Adobe AIR

I've been spoiled by the relative ease of developing interfaces using Web Technologies (Javascript, HTML, CSS) over tradition methods (OS-native API, wxWidgets, GTK, etc.). This put me off writing most desktop GUI applications. That includes my, now abandoned, C++ Cairo-based GUI framework I attempted to make to simplify desktop GUI app development. For the framework, all my motivation was sucked up by C++ (since it's easier to port a C++ library other languages, not to mention Cairo & native APIs are in C) and the current results being where I wanted to avoid. Programming desktop apps aren't as fun as their web cousins.

The closest I've probably used to being enjoyable was .NET 3 / WPF, which allows you do develop GUI using XML, quite similar to HTML. But .NET's visual studio is pretty slow, no cross-platform support, and XAML extremely verbose.

I finally started re-investigating Adobe AIR. I've looked into it in the early betas, but I don't quite remember what drove me away. Quite frankly, I'm perplexed why, it's a breath of fresh air from the traditional GUI frameworks I've been mangling with. Instead of focusing on building something that just looks sane and functions correctly, I can iterate on what's seems most usable (although I'm probably far from great UI usability design).

Noteme-early

A personal "tinkering" project. Only CSS/HTML so far.

For those that aren't aware of Adobe's AIR framework, it's just about a browser with desktop-permissions. AIR utilizes flash and webkit for its rendering. AIR applications do require the AIR runtime framework, but it's relatively fast to install over the .NET framework and even allows users to quickly install air applications through their web browser.

My only critique of AIR is that you really need to love ECMAScript/Javascript, since all your heavy lifting will be in that language. Using Flash/Flex won't let you escape Javascript. Actionscript is a dialect of javascript. But if you're a web developer, that shouldn't be too much of an issue.

  • Share/Bookmark

Recent Posts

Topics

Archives

Following

Links