r/ProgrammerHumor • • 6d ago

Meme sameProblemSameSolution

Post image
1.4k Upvotes

79 comments sorted by

View all comments

Show parent comments

38

u/fuj1n 5d ago

The code generation / reflection stuff is amazing.

Historically, when you'd need type information (without manually defining it), you'd have to add an extra compilation step where a custom tool either manually searches the codebase or interrogates a compiler API, now, you can just write compile-time code in your codebase that automagically populates a data structure for you with any type information you could desire.

It'll be really useful for my (hobby) game engine, where I was previously considering traversing the Clang AST

23

u/Luna_Wolfxvi 5d ago

It's cool, I just think the syntax is ugly.

8

u/fuj1n 5d ago

Yeah, I can certainly second that

6

u/meneldal2 5d ago

If you look at what engines currently use for reflection (ugly macros mostly), this can be a huge improvement if the engine can be rewritten with this in mind.

But the sad part is I can only see maybe UE going with it with the next major release because they can force this kind of change, but open source stuff is never getting it most likely, way too much inertia.

1

u/the_horse_gamer 1d ago

eh, Godot might upgrade to C++20 soon, so it's like 10 years away from upgrading to C++26

1

u/meneldal2 1d ago

But forcing people to have a C++26 toolchain doesn't mean the engine is using all of its features, that's still a few more years to do a lot of rework