by pjmlp · 6y ago · 0 comments
Classes as concept, are nothing more than extensible modules, and in that regard C and Assembly are pretty much the only mainstream languages that eschew such abstractions.
You can also develop GUIs in Assembly, and I don't miss doing that.
Interesting that you mention Tcl/Tk, given the OOP extensions that were all the rage when version 8.0 came out.
If you're talking about ML-style modules, that really can't be farther from the truth, both in theory and how they're used in practice.
Modules can be used (among many other things) to implement abstract data types, which are conceptually a bit easier to compare to objects[0]. Then you'd have to go into structural vs nominal typing, functors vs generics, etc.
[0]https://www.cs.utexas.edu/users/wcook/papers/OOPvsADT/CookOO...
Julia implements polymorphism without OOP. Modules are better than classes anyways. The whole Java ecosystem tried so hard to bring modules back as components and failed miserably.
If we are going to talk about all types of interfaces then OpenGL is a clear winner. That last time I checked it uses a procedural interface and vertex buffers directly. Why a procedural interface ? Because OOP is incapable of dealing with any complex data structure other than lists in a performant way.
C++ and Java don't break anything that a bad designed module won't be doing as well.
OpenGL a clear winner?!? The 3D API that should never haven gotten outside SGI with its global variables and state?
OpengGL is faster. Procedural code is always faster. Global variables are infinitely better than pretending problems vanish with singletons and AbstractFactoryMakerProducer. I remember going from C++ to Java, what a joke. C++ is infinitely better than Java because it doesn't suffer from OOP monothinking which is beyond pathetic. It was the first time I realised programmers would repeat marketing slogans without verification.
OpenGL is a garbage API that I repent having spent so many years dealing with its Frankenstein API design.
Fast? Only if you happen to use the magic incantation of data structures and the driver happens to play ball.
There is a reason why all modern 3D APIs are object based, including Vulkan with its handle model.
OOP based C programming is used all over the place in the Linux kernel, in spite of Linus opinions regarding C++.