in the unreal engine course lecture 94 ben shows us how to refactor the code in the grabber class. in one instance he made two function that have the same exact code to obtain the players viewpoint and update the Location and Rotation variables. One to return the end of the raycast line and one for the beginning.
Ben says its Ok to duplicate base code as they are needed to return the two different components. But what if instead of making two separate functions, you stuck to only one and is controlled through parameters?
I propose we name the function GetReachLine (FString) which will take a string as a parameter. as arguments I would either type out “End” or “Start” and respectively in the code I would check what was written and return the appropriate variable accordingly.
not sure if what I proposed is better so any feed back on this would help a lot, thank you