bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/C++/C++ Classes
C++•C++ Classes

C++ OOP

Flash cards

Review the key moves

1/3
Core idea

What is the main idea behind C++ OOP?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Order

Put the learning moves in the order that makes the concept easiest to apply.

Object-oriented programming is about creating "objects", which can hold data and functions that work on that data.
OOP stands for Object-Oriented Programming.
Procedural vs Object-Oriented Programming

C++ What is OOP?

OOP stands for Object-Oriented Programming.

Object-oriented programming is about creating "objects", which can hold data and functions that work on that data.

Advantages of OOP

  • OOP provides a clear structure to programs
  • Makes code easier to maintain, reuse, and debug
  • Helps keep your code DRY ( Don't Repeat Yourself )
  • Makes it possible to create full reusable applications with less code and shorter development time

Tip

The DRY principle means you should avoid writing the same code more than once. Move repeated code into functions or classes and reuse it .

What are Classes and Objects?

Classes and objects are the two main aspects of object-oriented programming.

A class defines what an object should look like, and an object is created based on that class. For example:

ClassObjects
FruitApple, Banana, Mango
CarVolvo, Audi, Toyota

When you create an object from a class, it inherits all the variables and functions defined inside that class.

In the next chapters, you will learn how to:

  • Define a class
  • Create objects
  • Access class members
  • And much more

Procedural vs Object-Oriented Programming

Procedural programming is about writing functions that operate on data.

Object-oriented programming (OOP) is about creating objects that contain both the data and the functions.

In procedural programming, the code is organized around functions. In object-oriented programming, the code is organized around objects.

Next

C++ Classes and Objects