D is our last hope

Martyn martyn.developer at googlemail.com
Fri Dec 8 12:25:12 UTC 2023


On Friday, 8 December 2023 at 07:04:29 UTC, Paulo Pinto wrote:
> On Thursday, 7 December 2023 at 20:37:17 UTC, ryuukk_ wrote:
>> On Thursday, 7 December 2023 at 19:21:10 UTC, Paulo Pinto 
>> wrote:
>>> On Thursday, 7 December 2023 at 14:32:26 UTC, ryuukk_ wrote:
>>>> [...]
>>>
>>> Unreal is also full of OOP, and Unreal C++ alongside 
>>> Blueprints uses a GC.
>>>
>>> Their business is doing quite well.
>>
>> Not if you want to write fast and efficient code
>>
>> Look at what studios are doing with these engines, they all 
>> work around these mistakes
>>
>> In fact, Unreal is internally planning a ECS/data-driven 
>> stack, Unreal isn't a new project, it's multiple decades old, 
>> with that comes tech debt and poor design that are hard to 
>> correct
>>
>> https://www.youtube.com/watch?v=f9q8A-9DvPo
>>
>> The value of Unreal isn't OOP, it's its graphics stack, editor 
>> and platforms it can reach
>
> As long as C++ classes, data members, function members, 
> inheritance and method dispatch are used to implement an ECS 
> system, like on that linked video, it is OOP.


There are so many things to unpack.

Firstly, we are talking about C++. Not Java. Not C#. Not Python.. 
etc.

I am not an expert C++ programmer. I dont think there are many 
people in C++ land that can really be considered 'an expert' 
except for those that dive in heavy to figure out what the 
compiler really does to your code and the C++ tricks needed to 
bring out the best outcome.

(I am happy sticking with languages like C, not forgetting D and 
open to Odin or Jai.. and I would say this 1000 times over if I 
was creating a game)

If I entertain the idea that I HAD to write a game in C++, it 
will mostly be C-like code, except for some handy features C++ 
has (over C) as long as it does not come at a cost!

Now could there be reasons to create a class? Sure. However, if I 
do, I would have to truly understand what the compiler is doing 
to that code. Could I be adding method overrides or inheritence? 
Possibly, but I very doubt this code would be part of in-game 
logic. It is likely part of some editing tools that 'compiles' to 
raw data for in-game, generally speaking.

As I say - whatever. So you have Unreal engine using OOP. I can 
assure you they are being vary careful with the usage of classes, 
inheritence, overloading, etc, based on their C++ knowledge. They 
likely have extremely skilled C++ guys over there. This is not me 
blowing their trumpet but they wouldn't be getting average 
developers in for a tightly skill area. Again, we are talking 
about C++ that still gives you control compared to other 
languages.

You also have to remember that the Unreal Engine/Editor are tools 
for the masses. Unreal engine is avaiable for school kids, small 
game companies, to large AAA ones. Blimey, even a retired OAP 
could dabble in Unreal if they wanted to! Different people with 
different skill levels - so it has to cater to the majority so 
why not OOP-like? I mean, if they don't provide some sense of 
familarity, their competitors will.

To me, this could be the driving factor why there is OOP. It may 
also be because it keeps a level of similarity right back to 
Unreal Engine 1 days (which, from memory, the scripting language 
was OOP)  - Scripting languages are not been the appeal in gaming 
for a while, replaced by hot reloading or, as Unreal uses, their 
visual 'language' named blueprints.

While OOP is used, I don't find this to be a good reason to prove 
anything against my original post that (kinda) mocks using Java 
back in 1998.. to having shared views with someone I found on 
youtube that is respected in his field. (Mike Acton)

Any further reply, as far as I am concerned, it just trolling.








More information about the Digitalmars-d mailing list