In BullCowGame, when we were passing FString as parameters we would only pass the reference to the FString, and also protecting the parameter from being changed by using const.
During the challenge I wondered if it was better programming to do the same thing for this function, e.g. when defining the function in the header file, could I do it as such?
void OpenDoor(const float& DeltaTime);
I thought that since DeltaTime is a float, it’s size in memory is probably not that big, so maybe using a reference is overkill, so instead I just kept it as const e.g.
void OpenDoor(const float DeltaTime);
Is this good practice to protect DeltaTime from being changed by using const, or am I overthinking this?
Anyone else had a similar thought, or can explain which way is best and why?