3 ms·
That's exactly why modules are better than classes because they don't have inheritance. It allows for simpler solutions. No debates about taxonomies. OpengGL i
by foobar_ 6y ago
That'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.
- foobar_ 6y agoI think you are finally getting it. Modules ~ Components. Where you and I differ is you think Component = Object. I think the difference is sufficient enough to warrant a complete divorce from the word object. Linux kernel uses components, not objects. The ideology of OO is using classes and inheritance to design software. It is an abysmal failure of software engineering, only mediocre managers use OO anymore and pretend visitor pattern is still a thing. All successful OOP projects use components in a disguised form and use a separation between Data (Value Objects, POJOs) and Code (Services). All failed OO projects use classes and take 3 years to deliver even the dumbest of software.
- layoutIfNeeded 6y agoModern OpenGL is also object-based. You select which instance you want to interact with via glBindX.
- pjmlp 6y agoAZDO is not compulsory and rarely seen live, for example it isn´t supported in ES or WebGL variants.