Chapter 3. Namespaces and Classes: Organizing your code


Great developers keep their code and data organized. What’s the first thing you do when you’re creating an app? You think about what it’s supposed to do, whether you’re solving a problem, creating a game, or just having fun. But it’s not always obvious how individual statements fit into your app’s bigger picture… and that’s where classes come in. They let you organize your code around the features you’re creating and the problems the app needs to solve. Classes can help you organize your data too, by using them to create objects that represent any “thing” your app needs to know about—and the classes that you design serve as “blueprints” for the objects used in your app.

Classes help you organize your code

Let’s be honest… you’re going to write a lot of code throughout this ...

Get Head First C#, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.