Tuesday, November 14, 2017

Advocating Tcl/Tk for GUI development

I am really surprised of very few uses of Tcl/Tk for GUI building. It’s a super-simple programming language, you can learn the syntax in only one day if you are accustomed to programming in other languages. Portable across Unix/Win/Mac OS. The Tk toolkit allows you to build GUIs directly by defining the hierarchical relations between GUI elements (widgets) and attaching event-response functions with parameters. It is an object-based rather than object-oriented system and this preserves simplicity, easy of learning and maintaining. There is no need for a graphical GUI builder too, everything can be scripted with much less code to write compared to other solutions. I’d like to see a desktop environment fully based on Tcl/Tk, at least on Linux. I really do not like the complexity of Qt and Gtk. GUI development should not be done in system languages like C and alike, but in high-level scripting languages. There is no need to scale up, every GUI is used only by one user. Sun decided to market Java, a system language, but without any operating system based on it, so any advantage of being low level is just a disadvantage. Using Java for some high-level task like GUI building is certainly possible but very far from optimal. But without starting a language war, we should just recognize no language is best at everything. This is why is often worth using more than one language in the same project. Tcl/Tk can be embedded in various system languages, so the GUI can be implemented in Tcl/Tk and the rest in the hosting language, if more appropriate. I wish there were more Tcl/Tk users and more support, but I must acknowledge the reality: there are many languages in computer science, some generic, some specific, and they are often misused. Programmers are responsible to make the right technical choices. If managers do that without considering alternatives, then you have a disaster: a lot of money lost and development headaches, which could be avoided.

No comments: