oopwindowconsole-applicationprocedural-programminggraphical-programming

The suitability of a procedural programming language for graphical applications


Is anyone able to explain or evaluate the suitability of a procedural programming language for graphical applications, against object orientated programming for instance. What are the advantages and disadvantages of both?


Solution

  • It is possible to use either since you will probably be using some framework to design the GUI.

    For example, if you are considering C then you will probably use GTK as framework. But you can still use the C bindings for other frameworks such as WxWidgets (written in C++).

    But: Procedural Programming isn't really strong because a GUI isn't a procedure.

    A procedural environment relies on location in the program (which usually translates to time) to distinguish between different kinds of interactions. A GUI environment relies on location on the screen to distinguish between different kinds of interactions.

    So, in a procedural environment you either smush everything together, so you have a place in the program which does everything, or you have a fake GUI, only some parts of the screen will work at any specific point in time.

    That said, I should point out that it's not impossible to write a decent GUI from a procedural environment -- it's just a bit tricky.

    And then there's the other way of looking at it: a GUI is like, chocolate, with lots of caramel, and a procedure is, like, all this paperwork. They just don't mix all that well.