Palm's Mojo SDK for the Pre mixes simplicity, rough edges

With Palm's WebOS and development tools, Web programming ascends to the throne and powers the app layer, but Palm's platform is clearly a work in progress

Page 2 of 3

These completion routines can be helpful because the current style of WebOS programming is closer to the endless classic model-view-controller (MVC) paradigm filled with longVariableNamesWithDescriptiveClauses common in Java programming. They still haven't picked up the tight shorthand emerging from worlds like jQuery.

For instance, each page is called a "scene," which, in turn, consists of some HTML listing the widgets and a JavaScript file called an "assistant." The HTML and JavaScript are separated into different directories in proper MVC style. You create the widgets by placing a DIV in the HTML and write some JavaScript code to fill in the DIV with the right widget afterward.

[ See how the Palm Pre stacks up against the iPhone in InfoWorld's mobile deathmatch. | Read Peter Wayner's developer's-eye view of smartphone platforms. | Get the InfoWorld editors' enterprise iPhone Deep Dive PDF report. ]

HTML vs. JavaScript
The HTML and the JavaScript are both working with and against each other. In the latter case, the JavaScript usually wins. You can add design details in either the HTML or the JavaScript, but the JavaScript will end up wiping out anything you do with the HTML. In most cases, the HTML is an empty vessel and the JavaScript does all of the work.

This framework is dramatically easier than using something like Objective C. There's no need to deal with memory allocation or pointers, two briar patches that often trap even the best developers. The appearance is specified in the HTML and CSS, languages spoken by graphic designers. The MVC architecture means you can hand the HTML and CSS to the designer and the JavaScript to the developer. When they're done, you can usually mix them together -- with the aforementioned caveat. If your JavaScript creates buttons and widgets, it won't matter much what the Web developer does with all of the DIVs.

It's worth noting that WebOS development will not be simple for everyone who can build a good-looking Web page. You'll need to know JavaScript and be familiar with the idea of creating a layout by instantiating objects, not putting tags in the right order. This is still a job for real programmers, not Web designers.

The WebOS offers a structure that will be easy for any programmer who's been working on AJAX Web applications, but this won't be enough for some. Game developers used to OpenGL on the iPhone and Android won't be able to do much in 3-D. But I think that casual, two-dimensional games will be easy once people get used to the idea that DIVs can roam all over the page in different layers. Look at this version of Tetris for an example. If that's not good enough, Adobe has announced it will deliver a Flash player for WebOS.

Palm has only begun to scratch the potential of a Web-based operating system, and there are many fertile avenues for development. If Palm isn't working on embedding jQuery already, it should start finding a way to borrow ideas from the more active corners of AJAX development. The Mojo documentation notes that the Prototype functions are often available but the $ function won't work across scenes. I'm guessing that the next generation of the libraries will include all of the best ideas from jQuery. Palm would be smart to make it simple to use jQuery plug-ins.

palm-mojo_sm.gif
Palm's emulator and inspector are easily controlled by an Eclipse plug-in, which also builds out the templates for the "scenes" that are part of a Palm app.
| 1 2 3 Page 2
From CIO: 8 Free Online Courses to Grow Your Tech Skills
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.