5 ms·
You missed the first point I made. C++ / Java break encapsulation by using methods and pretend they are encapsulated. Julia implements polymorphism without OOP
by foobar_ 6y ago
You missed the first point I made. C++ / Java break encapsulation by using methods and pretend they are encapsulated.
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.
- pjmlp 6y agoModules are classes without inheritance. 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?
- foobar_ 6y agoThat's exactly why modules are better than classes because they don't have inheritance. It allows for simpler solutions. No debates about taxonomies. 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.
- pjmlp 6y agoModules can still be generic without inheritance, it is a matter of language and implementation. 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++.
- foobar_ 6y agoI found OpenGL easy enough as compared to DirectX which is an abomination. Another problem with OOP, it breaks ABI because of name mangling. Had people just stuck to modular programming without inheritance this would have been a non-issue. Namespaces would have become underscores or something. You can almost backtrack all the horrible decisions in C / C++ and compare it to wirth languages which tried modular programming, bounds checking .... > Vulkan with its handle model That sucks. The performance is going to be slow. It's possible they did not go full OOP because of performance. > OOP based C programming is used all over the place in the Linux kernel Nope. They implement interfaces / modules using structs. Again, no inheritance and "classes". The most popular example being drivers and filesystem.
- pjmlp 6y agoOOP doesn't require inheritance, and structs with function pointers are how "classes" get done in C, better brush up your knowledge of OOP, and while you are at it, learn about Vulkan as well. Also in case you have missed, all proprietary 3D APIs are either OOP or object based. I wonder where is the OpenGL C implementation that will outperform LibGNMN. By the way, one of the reasons why OpenCL failed to gain market shared was its focus in C, instead of the nice C++ libraries provided by CUDA. When Khronos woke up and decided to offer such APIs, it was to late, now we have OpenCL 1.2 renamed as OpenCL 3.0, and SYCL is being re-designed to be backend agnostic.
- foobar_ 6y agoFrom a quick read, Vulkan doesn't use inheritance. Its using the C module approach. Even the Web DOM doesn't use inheritance. It seem in the real world no one uses imaginary objects and everyone uses structs.
- pjmlp 6y agoAdvised lecture, "Component Based Programming". Again, OOP is not 100% about inheritance. It seems some people keep not learning what OOP is all about and relate OOP <===> Java.