I often hear some said OOP is bad. But their explanations are out of my ability to understand. My glGUI progress is slow because I have limited time for working on it. I am neutral, I'm not a OOP fanatic but I can't write GUI without using OOP.
What I want to ask is:
Can anyone write me a simple code of GUI or TUI module without using OOP?
So I can learn from the code and rewrite my glGUI without using OOP. By experience it myself I can understand how good or bad OOP is.
I'm sure writing GUI module without using OOP is possible but I believe it should be very hard. Please prove me wrong.
I believe, a GUI or a GUI item
is an object, like most external devices, might it be a CNC machine, a printer or a moon rocket...
It has an internal state (member variables) and these must store and reflect the state of the external object and for this handler procedures are used.
Usually these routines are not reentrant, because the external object is not reentrant.
So if you do it with a non-objectoriented language, then you must mimic object orientation.
If typeextending and inheritance is needed, then you must use typecasting.....
BTW, I am autodidact too and I did embedded programming in C and assembler wrote software to control and visualize a high pressure autoclav, in Turbo Pascal 30 years ago. There was no internet and I learned out of books and journals. I got no formal education but formal selfstudy and got my education on the job.
But I had formal education on electronics.
And sometimes it is important to know the problem that has to be solved. All formal education doesnt help if you have to solve a problem that you dont understand, this is why most drivers for UARTs are buggy.