tags:

views:

127

answers:

5

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.

+1  A: 

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.

+1  A: 

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.

Amarghosh
Thank you, Adobe Air seems very interesting. As for using XUL for real programs, you might want to look at this page: https://developer.mozilla.org/en/XULRunner_Hall_of_Fame
Andrea
Thanks @Andrea !
Amarghosh
Not sure why this is the accepted answer, because the question was whether or not you should learn XUL, and this response has not even referenced XUL in the portion that his not been struck out for being inaccurate!
pc1oad1etter
A: 

Look into WPF, which leverages XAML, which is probably going to be a not-too high a learning curve for you.

If you're using Ubuntu, you might want to take a look at Mono framework, which is C# on Linux systems. A form of XAML exists, called Moonlight, which might be useful for you. At least an option you can examine!

code4life
Do you mean Window Presentation Foundation? I should have mentioned it in the actual question, but I mainly use Ubuntu, so that is not really an option. Sorry I was not precise.
Andrea
Ahh... WPF is not an option then...
code4life
A: 

i am in the same shoes as you. so far i have looked at

and missed out XUL ... hmm ... 1 advantage of XUL is that i can use it for Firefox addons :) opens up possibilities.

i find that for both titanium and air, the documentation is kind of lacking so i find it harder to get started. i nv really started on silverlight but i did with WPF. for air i find that its webkit is modified to disable some css3 features i'll like to use like @font-face and shadows :( disappointed

there are attractive advantages provided if i use a "native" desktop programming language

  • WPF/C# has great integration with the Windows 7 (eg. jump lists, taskbar thumbnails etc) that may improve productivity of users
jiewmeng
+2  A: 

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.

pc1oad1etter