lexagraphical (spelling, or typos) can happen
syntax errors can happen
turnleft(); turnLeft; turnLeft()
Errors in logic can happen - The code compiles, but it doesn't do what you expect, or it will turn off if you run into a wall or pick up something that isn't there, or put down something you don't possess.
Consider the following:
It an be fixed by adding one method call.
Here is some code in need of debugging: