Singles: In natdex, it's pretty bad. Surf, Scald, and Hydro Pump are much better options due to 100% accuracy, chance to burn, and higher BP. Same goes for OU. It's even in the list of 'usually useless moves'
Doubles: In Doubles, Muddy Water is a good move. It hits both adjacent opponents, unlike Surf and Earthquake which hits all adjacent Pokemon, and it is stronger than Rock Slide at the cost of being less accurate. Also, lowering accuracy of (potentially) both opponents is always a good thing.