Reflection in C++
donw.io
Reflection in C++
1–10 of 40 posts
Re: Reflection in C++
#2Re: Reflection in C++
#3"struct Class : pubic Type". It says "pubic" instead of "public". I hope it can be fixed.
Re: Reflection in C++
#4Re: Reflection in C++
#5"is a bad idea".
Using something like Google's Protocol Buffers or a similar system where you generate a standard serialization backend for all the plain old data types you want to send across the network is way less of a pain in the ass.
If you're concerned about the overhead, look at MsgPack or Cap'n Proto - plenty of ways to shave the yak out there without needing to roll your own.
Re: Reflection in C++
#6There's a typo. "struct Class : pubic Type". It says "pubic" instead of "public". I hope it can be fixed.
Re: Reflection in C++
#7"is a bad idea".
Games need a lot of iteration, C++ compile times can easily get very long i.e. minutes. You might object that compile times should never be long: "oh this never happens if you do X or Y" but in reality every C++ gamedev shop I've worked at has had long compiles times. Templates and other things of that nature tend to bloat it.
Anyway so reflection helps with:
- Hot-reloading code
- Tweaking reflected values at runtime
- Exposing functions for scripting languages (without having to write lots of repetitive boiler plate code)
- Saving / Loading
(And networking but that's not something I've experimented with personally!)
Depending on how it's implemented, at least for games, it's worth it.Re: Reflection in C++
#8Re: Reflection in C++
#9Alan Kay (inventor of Smalltalk)
Re: Reflection in C++
#10"is a bad idea".
In game development it tends to help solve some common problems. Games need a lot of iteration, C++ compile times can easily get very long i.e. minutes. You might object that compile times should never be long: "oh this never happens if you do X or Y" but in reality every C++ gamedev shop I've worked at has had long compiles times. Templates and other things of that nature tend to bloat it. Anyway so reflection helps…