Importantly, you don't get that safety in comments or strings.
The nice thing about replacing via vim is that you can restrict it to a selected block which also gives you a type of safety.
Particularly for the situation I used replacement today, an IDE couldn't make it better and doing it only on a range was helpful.