Hello everyone!
I am actually loving the UE5 courses and I am super happy to have bought them.
I am already a professional developer (not (yet? ) a game developer, though) and, as for my experience, I always try to not duplicate code lines.
For reference, I am attending the “Variables” tutorial of “Warehouse Wreckage” from “Unreal 5.0 C++ Developer: Learn C++ and Make Video Games”.
We can get, set and print the value of a variable using some nodes; in the video the teacher duplicates the “Get” and the “Print” nodes by calling them in two different parts, like this (for sure this choice improves the readability):
But I have used this alternative, in order to not duplicate nodes:
And here comes my question: does duplicating nodes affect the performance/memory allocation?
Like: under the hood, are we accessing the same variables and the same functions, or references/pointers get duplicated somehow?
Of course this scenario is quite simple and I guess the impact on performance would be minimum, but what about complex projects? What is the best practice?
Thank you in advance!
Best,
Alberto