Couldn't find this answered already, surprisingly.
For example, for a game (in my case a 2D top-down one), there could be advantages to doing so. For example, whenever you want to change an entity's direction, you just assign entity.direction = unitVector
and bam, the direction is changed.
Similarly, if you want to apply a powerup that increases their speed, you just do entity.speed += 5
, since it's a scalar value.
However, I also see advantages to keeping them combined. For one, a vector is already the combination of magnitude and direction, so it feels natural to combine into a single value. Secondly, it prevents desync. For example, if you have some sort of function that modifies the an entity's velocity, you have to constantly check whether you're dealing with direction or speed, and also be sure to update both values independently, which can be confusing.
How is this generally handled in the majority of cases? Are they combined, or not? And if they are combined, what are the recommended ways of changing just the speed, or changing just the direction of this combined vector value?