I think that's good advice, and I think it's important for bassists to use their ears to figure out how to best serve any song.
The bass often plays a role that's like laying a bridge between the rhythmic elements and the melodic elements. You can't be the best bridge if you're only paying attention to one of those things. I do think that in most applications there's an order of priority.
An inexperienced player can do a fairly competent job in a lot of genres by just doing root-5, if they're rhythmically solid in the pocket. But you will make things really sing if you play in the pocket and also take your melodic cues when they present themselves. Being able to that might be the icing on the cake that sets the really good players apart from the average.
The bass often plays a role that's like laying a bridge between the rhythmic elements and the melodic elements. You can't be the best bridge if you're only paying attention to one of those things. I do think that in most applications there's an order of priority.
An inexperienced player can do a fairly competent job in a lot of genres by just doing root-5, if they're rhythmically solid in the pocket. But you will make things really sing if you play in the pocket and also take your melodic cues when they present themselves. Being able to that might be the icing on the cake that sets the really good players apart from the average.