Thursday, June 6, 2013

Which Language to choose for a User Interface

I do not have much of an industry experience when Desktop Applications are concerned. Whatever I learnt, I learned as a hobby. I still remember me wondering if I could build desktop applications the way professionals did. I started computers by learning C++.

I have worked on both Web Applications as well as Desktop Applications using J2EE and related technologies. There was one thing very clearly stated - you can not live in both the worlds. I always challenged the notion and worked equally in both these different ways of programming. Though it gives me a great sense of control over the language Java (at least id like to think this way), but I'll take it, it was never that easy.

I'll take a step back and also mention that Java has a very strong framework for building GUI's called Swing. I created some applications using it. It is just like creating any other simple Java application. No extra dependencies, and you have the world at you, creativity has no limits. Just that I found Swing getting bit difficult as an when the complexity of the Application increases. Dividing each UI component into different classes, making sure that they interact well, mapping heavy models with UI etc. 


The world looked content with Java Swings, but still people prefer technologies like Adobe flex for Desktops Apps. According to Oracle, the Java Runtime Environment is found on over 850 million PCs (source: wiki). Then why is such a powerful language not the current favourite for creating desktop Apps. Even if we consider web browsers, then, Java is installed on roughly 70 percent of Web browsers, which makes it the second most popular plugin behind Adobe Flash, and places it before heavyweights such as Quicktime, Windows Media Player, or Silverlight. Java is also popular on mobile devices. 

If a language that has such a deep penetration worldwide, why is it not the very best choice for creating user interfaces. What could be the possible pull backs that stops a developer from exploring the real power of Java. Is the applications difficult to design? Does it weigh too much on a developer to convert artefacts from creative into Java? Is it heavyweight for real complex applications and hence slow for a real smooth user experience. I can say these could be issues for a poorly designed application. But the question that comes to me is how often can an application be a victim of not such a good design? How easily the application is susceptible to an improper or well thought off design? Many Swing developers will argue that Sky is the limit for them. True, I thought the same way until I learned Adobe Flex just to 

Going through the software available in the market for Application development, I could come up with some very good options. There are many  languages available today and I am pretty sure most of them will live up to the criteria of being a language that helps creating good Apps. There are languages like Java, python, VB.NET, C#, C++ and QT framework,  Adobe AIR etc. The list goes on. Now, .Net and Java languages run on JVM's while languages like C++ and QT run on Native OS. So definitely using Adobe AIR and C++ with QT is faster than languages that run using JVM's. Then why not use the native languages themselves and finish off the debate for once. The trade off is portability. There is a huge debate on using cross platform languages. The more the number of devices the more platform independent the application is expected to be. The obvious question that comes to your mind "Should the performance and efficiency be compromised for a want of portability"? There are a lot of topics that come to your mind when you rate a language - 

  1. Memory Management
  2. Readability
  3. Ease of learning
  4. Ease of understanding
  5. Speed of development
  6. Help with enforcement of correct code
  7. Handle complexity - algorithms etc.
  8. Performance of compiled code
  9. Fit-for-purpose
  10. Lines of code
  11. Supports Object Oriented
  12. Easier scalability of Apps
  13. Supporting IDE

The list (not in order - of course) is huge and what not could be included here. But that is not our motive here. The features that separates languages should be the determining factor. Starting with .Net related languages, these are great. I cannot help but mention that fact that I started my carrier by leaning C#, ASP.Net etc. Visual studio is a great IDE to work and helps improve the readability and hence the Speed of development is relatively good. It has a great MSDN library for reference and hence help is available. The drawback is Visual Studio 2012 is not free. There goes a lot of quotient related to readability etc. Something bigger that is the cause of concern is portability. Although, I am big fan of open source languages but I leave it on the reader to decide on the same. For me it goes 3 points down. A great language, great  documentation though.

Moving to Adobe AIR, the language is great. I learnt the language myself and found the real beauty of the same. When I started learning Adobe flex the concept of creating a xml based ui was very new for someone like me. It was the best way of creating a UI. Without contention I can state that Flex is still a amazing way of creating an App. The creative possibility for flex is unlimited. Adobe supplies an IDE for flex called as FlexBuilder that helps achieve various other features like ease of development,  readability etc. the concert of calling a script for events is a very smart way of achieving the event handling. Although flex may have huge capabilities as a language it comes with  SWF file that needs to be downloaded on a page load (increases onload performance , Desktop applications would require a Adobe AIR runtime to be installed. This may not be a big issue except that it is not generally found in client machines.
A drawback for the language, Flex Builder is not free and hence it shares some of the problems with .Net languages. Also, to use powerful features of languages like Java and .net, flex does provide integration plugins, useful feature but I suppose this might make connections slower between the two talking modules (Although I do not have enough evidence to substantiate the same). To conclude Flex, although portable, there are still some problems that stops me from diving into the same. 


Now languages like C++ and QT are of a different genre themselves. They are fast, give a lot of control to the programmer, even to a level that he can manage memory by himself. But then with great powers comes greater responsibilities. The more complex your code starts looking. Anyway, not considering that as a drawback because that goes on the developer himself and his capabilities. Portability, can that be a issue? Of course, that is one. But not sounding judge mental enough, this language is definitely the greatest so far. Its fast, gives more control etc. etc. we know it all. But honestly I have worked on C++ in my college and I find it better than many languages that I know off today. I leave it to the readers to decide. For me, I'll always choose a language that I am comfortable with and that meets all my requirements. At present I have not worked on C++ as a user interface language and hence not commenting on it. 

There are so many drawbacks in every language and advantages as well. Thinking about the same I stumbled upon Javafx2. TBC...


No comments:

Post a Comment