Noone's posted the correct answer yet: unit testing! Every method you write should have at least one test to go along with it. (Ideally, you write the tests before you code the functionality: when your tests pass, the object does what you need it to do, and you're done.)
Maybe that's not what you're looking for, though. You can't write a unit test to make sure you're using the correct block-level variables, as in the specific problem you had. But having reasonably comprehensive unit tests at least makes sure that all your code gets executed. At that point, the interpreter error messages ought to be as good as compiler errors, once you get used to the bugs you're apt to introduce in whatever language you're writing in (undefined method warnings being the Ruby indication that you probably mistyped something).
by dc — Dec 24
Maybe that's not what you're looking for, though. You can't write a unit test to make sure you're using the correct block-level variables, as in the specific problem you had. But having reasonably comprehensive unit tests at least makes sure that all your code gets executed. At that point, the interpreter error messages ought to be as good as compiler errors, once you get used to the bugs you're apt to introduce in whatever language you're writing in (undefined method warnings being the Ruby indication that you probably mistyped something).