O'Reilly logo

Head First Learn to Code by Eric Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. 12 object-oriented programming: A Trip to Objectville

Image

In this book you’ve used functions to abstract your code. And you’ve approached coding in a procedural manner using simple statements, conditionals, and for/while loops with functions—none of this is exactly object-oriented. In fact, it’s not object-oriented at all! We have looked at objects and how to use them in our code, but you haven’t created any objects of your own yet, and you haven’t really approached designing your code in an object-oriented way. So, the time has come to leave this boring procedural town behind. In this chapter, you’re going to find out why using objects is going to make your life so much better—well, better in a programming sense (we can’t really help you with other areas of your life and your coding skills, all in one book). Just a warning: once you’ve discovered objects you’ll never want to come back. Send us a postcard when you get there.

Breaking it down, a different way

Image

Remember back in Chapter 2 when we said there were two skills that you needed to learn to code? The first was breaking a problem into a small set of actions, and the second was learning a programming language so that you can describe those actions to a computer. At this point, you’ve learned a good deal of both ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required