Every program you write solves a problem.
When you’re building a program, it’s always a good idea to start by thinking about what problem your program’s supposed to solve. That’s why objects are really useful. They let you structure your code based on the problem it’s solving, so that you can spend your time thinking about the problem you need to work on rather than getting bogged down in the mechanics of writing code. When you use objects right, you end up with code that’s intuitive to write, and easy to read and change.
Mike’s a programmer about to head out to a job interview. He can’t wait to show off his C# skills, but first he has to get there—and he’s running late!
Mike built his own GPS navigation system, which he uses to help him get around town.
Mike’s navigation system solves the street navigation problem the same way he does
Mike’s Navigator class has methods, which are where the action happens. But unlike the
button_Click() methods in the forms you’ve built, they’re all focused ...