Hitting walls makes an AdvancedRobot take damage and it also brings any robot to a stop. It is usually a good idea to try not to hit walls.
A common form of wall avoidance is Wall Smoothing. This involves detecting when you are moving towards a nearby wall and turning so that you'll move along the wall instead. A simpler solution is to stop and reverse direction, but that makes your movement much more predictable.
An option commonly used in Melee is to use a movement algorithm that moves to a target point, then only choose points on the battle field. This is not foolproof - since turn rate is limited in Robocode physics, you could still hit the wall on your way to your destination.