Is there a label, goto handler like in basic?

It’s a metaphor for encapsulation and modularity. The more you tie the implementation of one class or object’s internals to another, the more the simplicity of your design will fall. (It also impacts the reusability of the code you write.) Controller classes, of course, are often custom for their situations, but internally their methods should remain as independent as possible, to make augmentations and additions easier.

Imagine a soda machine. You walk up to it, put in a dollar, press the drink button, and you get the drink you wanted. It shouldn’t matter to you how it works internally; all that matters is it took your dollar and gave you the selection you wanted–and if it didn’t have your selection, it would inform you. You could assume that there’s a complex machine inside, or maybe there’s just a midget with chilled cans of soda in a cooler, and he dispenses the cans when there’s a dollar and a selection. But that isn’t your concern. All you should care about is how you interface with the soda machine.

Ah. OK, I know the concept, but hadn’t heard it quite described like that - we always used the “black box” concept - input goes in (or a method is called) and you get out what you want, regardless of how it works. It could be rewritten 18 different ways as long as you get out what you expect. If you have a “black box” that coughs up sine values, doesn’t matter if it looks them up in a table or computes them as long as they’re right.

(silly story) Years ago I learned a very arcane programming language called RPG II (an IBM oddity of a language). It had its own fixed logic - input, then processing, then reports generated - no deviation! That process could be augmented by “flipping switches” by putting characters in certain columns of your “program.” It was a horrible language - I think IBM tried to “dumb down” the idea of a programming language but they actually created something that only a programmer could begin to understand.

My instructor at the time used the idea of a little “RPG man” running around in the computer like Mario from Donkey Kong. pushing buttons and pulling levers to get the machine to do the right thing. Your “midget in a soda machine” evoked that “RPG man.”

IBM developed RPG originally as a query language for punch card machines, which explains its form, I suppose:

http://en.wikipedia.org/wiki/RPG_programming_language

Hats off to anyone who uses it today.