Is using reflection (Unreal Property System) bad?

Hello all! Hello Unreal devs!

I very love to use meta-programming in different languages.

But my colleague says me:

it’s bad practice, don’t use reflection! Use best practices! Read more books!

I like use something tools in Unreal Property System such as FindFunction or IsInBlueprint to get is BlueprintImplementableEvent implemented if I use them in something.

So, situation: base logics can be used in C++ and secondary logics (for game designers used in child blueprint). However I need to take control for something realisation of logics in blueprint from C++. Is it good practice? What you think about that?

I see, the UE4 is fully metaprogrammed engine (Code generation, reflection, macros). And I think thats great! But what about game logics? Is good to use reflection in game mechanics?

Thanks! Have a nice holidays! Cheers!

By using UE4 you are forced to use it’s reflection system, all UObject classes need to be registered to reflection system to work properly, UObject pointer properties need to have UPROPERTY in order for memoery managment to work properly or else objects gonna be deleted as engine don’t see any refrence to it, reflection system is required to bind anything to property editors and blueprints, also some C++ event requires bind functions to be registered. So whatever you look at it with UE4 you aill need to use reflection system is some extent.

But you not forced to use it in some cases, like non-pointer varables if you wish you dont need to put UPROPERTY on those as well as all functions as it also no needed, some C++ features are not supported by reflection system like non-UObject pointer varables where you can’;t use UPROPERTY.

Not using reflection system indeed my save up some CPU and memory usage, but UE4 is so massive that it might not really give much difference

Your friend should read some books by himself.

Did he provide at least some valuable arguments instead of “reading books”?

There’s nothing bad in using reflection.

It saves your time and effort, because you don’t have to manually serialize everything or tell the serialization system how to serialize\deserialize your types by using some specific DSL.

For example, with protobuffers, you would have to describe your types in specific DSL so protobuf would know how exactly to serialize your type.