Thanks for the feedback so far. I agree on the boilerplate. Having to deal with header files is a pain with RPCs.
One of our goals with improving C++ usability is to avoid magically synthesizing function declarations. It’s weird to not have a declaration but to still have to implement the body. Jumping to the declaration of one of these magical functions would take you to a complicated macro. What’s worse, inexperienced developers would be treated to linker errors for method names they didn’t declare themselves, which most people at Epic thought was not a very good design. So we decided to try having users declare the functions themselves with the latest syntax.
Ideally, you’d even be able to configure the name of the function. I don’t particularly like that Unreal forces a naming convention on certain functions. But in this example, allowing the names to be configured would result in even more boilerplate code. (e.g., “UFUNCTION( WithValidation=ValidatePass)”)
We should keep discussing improvements we can make, and brainstorming ideas to reduce boilerplate while not introducing confusing things to new users. Also, it might not be difficult for us to continue to support the legacy syntax for users with existing large codebases. Robert would have a better idea about that.
We probably also we need to be more considerate and backwards compatible. We’ve discussed how we could possibly “version” Unreal C++ syntax changes. Alternatively, the idea has come up that we should “save up” a large number of syntax improvements and roll them out all together rather than trickling changes out with each version, which we initially hoped would be less disruptive.