I'm familiar with web programming, both client and server side, and I'd like to expand a bit my knowledge in order to be able to write some desktop programs.
My problem is that I'm not really familiar with the desktop way of managing widgets. As far as I understand, in a typical desktop programs, widgets have their own life, sending signals to each other and reacting to signals with callbacks. So every widget is an object with lots of methods. This adds a further complication with respect to what I know now, and I'm not sure I want to learn this at the moment.
On the web you tipically describe the elements on the page with a markup language, usually some version of HTML, and when an event is fired you modify the elements with Javascript. I'm trying to understand if there is a way to use the web paradigm in a desktop program. I'd like to be able to describe widgets via a markup language (these will be static) and alter them based on events. If I understand correctly, XUL based applications work this way.
The problem is that the documentation I can find about XUL seems a bit outdated. Is learning XUL a good idea? Can I expect to be still using it a few years from now? Or is it becoming already an old technology?
In case XUL is not a good idea, what are the alternatives? For the most simple applications, where the widgets static, or are only slightly modified, there are some easy tools, but what about a more complex program?
EDIT: I should mention I mainly use Ubuntu, so I need a linux or OS-independent tool.
XUL an provide essentially what you have asked. It is similar to HTML in that you use a tag-based language to describe the interface, and you can use JavaScript for your coding. It certainly is used for desktop develop, including such products as Firefox, Thunderbird, Songbird, and Komodo Edit/IDE.
Running on the desktop, you will have more freedom than running as a web app, reading and writing files, and, through XPCOM, even running non-JavaScript code.
There is a vast quantity of pretty up-to-date documentation at the Mozilla Developer Center. What you are specifically looking for is how to create a xulrunner app - this is the framework that will let you create desktop apps using XUL.
One certainly can create good desktop apps using XUL. The downside is that there is not large developer community (outside of Mozilla, Songbird, and extension developers), and there ends up not being a lot of support for people coming into the community to build apps. There is a mailing list, and there is an IRC channel. The challenge is that there will be quirks as you use xulrunner, and there will be limited support as you work through them. It's kind of a "chicken and the egg" problem, I think - a diverse, large developer community would lend more support -- and more support would grow the community.
I have been using XUL to develop a product for the past two years, and I still debate whether or not I would choose the same path again.
I don't think we have enough information to tell you "Should [you] learn XUL" -- but if you need a high level of support from a large community, then you should look probably look @ some other framework that others have mentioned. If you can slog through and are comfortable taking your type to work through it, it can be a good resource and your web background might help you hit the ground running. If you have any interest at all in Firefox Extensions, these skills will transfer directly.
Not having a strong web background, when I try to switch to work on HTML apps, I miss how easy it is to lay out an interface in XUL. If you want to tinker a little, take a look at XUL Explorer and the XUL Periodic Table.
You might want to check out Adobe's AIR technology. It lets you describe the UI using a markup language called MXML (similar to HTML, stricter syntax) and define the functions using ActionScript, a scripting language similar to JavaScript. AIR apps are platform independent as they run on AIR platform that abstracts OS specific things for you. They might be relatively slower than native apps for the same reason - but this may not be an issue for small applications. It depends on what's more important to you - running speed or development speed.
The main downside with AIR is that users need to install AIR platform on their machine to install and run AIR applications, just like you need to install Java before you can run any application written in Java. Most of the platforms come with Java out of the box nowadays, but AIR isn't that ubiquitous yet.
And about XUL, someone please correct me if I'm wrong, but apparently it is the markup language for describing UI in Mozilla's applications like Firefox, Thunderbird etc and used for developing extensions for their applications. I couldn't get any references to XUL being used for real desktop applications.
If you're that opposed to learning something like C#, you could write AIR applications with Flex. It has a markup language but also uses some real programming with ActionScript. For me it was a good introduction to writing desktop applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With