Sonar is the most accurate , Sharp IR is middle accurate
No, the Sharp IR is more precise than any hobby sonar. The sonar is a lot noisier the IR in general.
*But although an IR sensor such as the Sharp ones only returns the specific point in front of it (so that it might find a point you don't want), a sonar takes a sort of average.
*Also, an IR sensor won't detect very dark surfaces because the light is absorbed, whereas ultrasonic waves are always reflected.
*With the Sharp IR, you also have the problem of non-linear output, whereas a sonar gives you the exact time it takes the wave to go and come back to the sensor (from there you can easily find the distance).
*The Sharp IR is easy to read from a microcontroller, but you need an ADC. The PING))) from parallax is actually pretty easy to use as well, and doesn't need an ADC