I got an idea for an application that I wanted people to be able to run on their desktops and phones, and to be able to sync the data between their desktops and phones. I could do it as a web app and have it run on any browser, but that posed 3 distinct problems:
1. It is going to use and manipulate information the user may consider private or sensitive. I just don't want to store that information and be responsible for its security. Some elements will get stored on a server I maintain to aid in the sync, but because the juicy stuff isn't on it, I have less of a privacy/disclosure nightmare if my server is hacked. And because there's no "juicy" data on the server, it's a less attractive hacking target.
2: If I do it as a packaged application, I have much fewer headaches with cross-browser compatibility. Plus I can bring in features that some browsers don't have (and some do).
3: The more I functionality I run server-side, the more data transfer and processing overhead I have to cover. That means money I have to pay. So the more I can minimize this, the happier I am.
So I went looking for a programming framework and development environment that could support Windows, Mac, Linux, Android, and iPhone... at minimum. I found two.
Mono is an open source implementation of Microsoft's .Net framework. It allows you to code in C# or the .Net flavor of Visual Basic and use a cross-platform widget toolkit for creating your user interface.
Only one problem, their IDE for Mac doesn't support the cross-platform widget toolkit's visual designer and only the most recent version started supporting debugging. And when I loaded up Ubuntu in a virtual machine so I could try it on Ubuntu, the visual designer barely worked and was completely unintuitive.
There was going to be a learning curve for C# as it was, but my primary machine is a Mac and their Mac development environment's shortcomings were going to turn the learning curve into a learning wall. Still, it remained in the running because I could always run it in Windows via Parallels, and if I surmounted that curve, there was not only the payoff of some .Net libraries I could use to avoid reinventing some wheels, there was the fact that the .Net programming skills and apps demonstrating them on 5 operating systems might actually be very marketable.
Sadly, the "documentation" for the MonoDevelop IDE contains 5 articles and 4 screencasts, some of which are out of date. The other 11 chapters merely have "TODO" placeholders, so we can wait for important articles on UI development with GTK# and "Working with Databases".
Appcelerator Titanium is an interesting option for cross-platform development. It's a wrapper around the WebKit browser engine that allows you to basically create web apps that run locally. The wrapper gives you additional APIs that are accessible from the apps.
Upside, if you know a little JavaScript and HTML, you can be writing apps almost instantly. If you're a big fan of frameworks like Dojo, Scriptaculous, or JQuery, they're available. And when combined with the custom APIs for additional hooks into the filesystem and other OS features, it's pretty darn powerful. Then you add in that it offers PHP, Ruby, and Python interpreters. Then factor in the Greasemonkey style userscript capabilities (which let you write scripts that interact with pages from other web sites).
Then you come crashing to earth. Appcelerator has two development flavors: Mobile and Desktop. Desktop is sort of a Wild West free-for-all, where the sky seems to be the limit. But in the Mobile universe, you lose many of those features. If you ask why, there's one simple answer: "Apple doesn't allow it."
So if you want to develop one codebase that powers both Desktop and Mobile flavored apps, it's all going to be in JavaScript. And despite the Desktop flavor seeming to have a wealth more features, the Mobile flavor is much better documented. For example, the Mobile flavor has a "Kitchen Sink" demonstration application full of demos of UI hooks and methods for calling their wrapper API, but Desktop doesn't.
In fact, on their code wiki, their 9-chapter "getting started" tutorial only has 4 chapters finished. The remaining 5 chapters have just been outlined and left up to taunt beginners.
So if desktop seems to have so much more power to offer, why does mobile get all the documentation? Because there are 8,000 programming languages and IDEs that will allow you to rapidly develop a Windows application. The Android and iPhone spaces are just opening up. This presents a route to developing for what may well be the two hottest mobile platforms in the world with a MUCH lower learning curve than if you had to learn how to program Android and iPhone natively.
Creative agencies can start developing iPhone apps for their clients after giving one of their web guys a few days to get up to speed. You could probably code a fart button app in your first day, even if you were relatively new to web programming.
The Downside
Frameworks like Java, .Net, and Flash/Air are dependent on virtual machines. They compile the code you write not into a true ready-to-run application, but into an intermediate state called "byte code" that is then further processed by the virtual machine before it can be run. That gives them their "write once, run anywhere" capabilities. The virtual machine translates their byte code into code that the platform they're on/in can run.
The downside of this is that you can get a "decompiler" and translate the byte code back into a pretty good approximation of the original source code. If you have proprietary algorithms that you want to protect by keeping them secret instead of patenting them, you'll be out of luck, because .Net, Java, and Flash/Air applications can be reverse engineered.
But the problem with Apcellerator is that, for the most part, it's not compiling your code at all. Write your "Hello World" program. Package it in a Windows installer. Download it and install it. Then go into your C:\Program Files directory, find the Hello World app's directory, and drill down to the Resources directory. In it you'll find an exact copy of the Resources directory from your development environment with all your HTML and JavaScript files not only intact and unaltered, but you can open them up in Notepad, change them, and change the operation of the "installed" program.
That just sort of bugs me. I can't think of any way it can be exploited to harm users unless they've already been compromised, and in that instance it's more of a case of the burglar already being in the house and the Appcelerator app just being the lamp he decides to hit you with. But users being able to go in and change code in an installed application... seems a recipe for something bad.
Hopefully future versions will create unalterable checksums for these files, so each time the file is run/loaded, if its checksum is different than the checksum created at packaging time, there's an error message and the code isn't run.
You can get around some of it by using a compressor or obfuscator. Using something like Packer not only creates unreadable code, but even if it gets decompiled/decoded, it's still a lot harder to read and change than your well-whitespaced, well-commented source.
The Final Decision
I'm going with Appcelerator. I won't really create five programs at once because the Desktop and Mobile UIs are different, and there are some differences in the APIs, but a large piece of my code base can be written just once and power both the Mobile and Desktop flavors of my app, and it's not nearly as frustrating as Mono.


Entries (RSS)
I messed around with Appcellerator Titanium last week too, and found a lot of the same issues. All I need (at this point, at least) is the desktop side, and the documentation is pretty weak...