Saturday, March 10, 2012

UI Framework

Seriously, if you are a C/C++ Windows programmer it is very likely that you were forced to write UIs. UIs are a necessary evil, because it is how our software converses with the user, which is probably my least favorite part of the software process chain. A user likely does not care that you saved RAM, you optimized loops, you replaced a whole switch case based decision tree by a XML file and that you even placed the XML settings based file on a dynamic STL container. No, users care for how "beautiful" an UI is.

Microsoft has provided an API, which is strangely associated with UI design while in fact, most of its usability lie in helpful functions for threading, networking, file copying, etc. Some crazy folks program UIs using the API. Some of them do that because they are genius, while others do that because they like to brag. Chances are that the latter dudes do not write software for reasons like supporting a family being a programmer.

Microsoft has given us Microsoft Foundation Classes aiming to make the life of the programmer easier. Borland tried that too. They succeeded in  some ways. MFC is fast, OWL and the later C++ Builder are fast and easy to learn. MFC UI design is painful, because you are required to rely on thousands of code lines that MS wrote for you and you hardly have easy UI classes to dabble with. For example, try to write an application with multiple tabs, basically you will need to write two new classes. Honestly, UI design has given me much trouble. Specially while using C++ and MFC.

I was rather reluctant to use Qt, because you see, Qt is a holy grail for UI linux programmers, and linux programmers are not windows programmers. Yet, after using Qt for a month or so, this framework has captivated me. Basically, you can have lots of useful classes and the design is not totally RAD, but it is OOP based, rather more than MFC. And it allows you to focus on the code it self. My tasks has been for years to grab bytes from A and transferring to B, and processing this data and displaying for those evil persons called "users". Qt has allowed me to avoid much of the pain of UI design and thus making me away from the user needs: Qt makes UI design faster . Don't bother with WxWidgets or other multi-platform framework, Qt is the way.  It is like having a Swing API for C++. Java is a very fun, decent, awesome language. But it is not fast enough for windows. Specially if you like me, works with "transferring to B, and processing this data and displaying for those evil persons called "users"."

Qt your self dear colleague. Ask your boss to Qt him self. They wrapped the Windows UI API into something fast, easy to use and sane. And best of all, with a few changes your application will run on that painful OS called Linux.

Just kidding, my only complaint of Linux is due to development issues, Ubuntu is pretty decent. Like CentOS.

No comments: