flâneur — a map of the web's best reading

13.1 — Welcome to object-oriented programming – Learn C++

learncpp.com · 1,507 words · saved by 1 readers

Back in lesson 1.3 -- Introduction to objects and variables, we defined an object in C++ as, “a piece of memory that can be used to store values”. An object with a name is called a variable. In traditional programming (what we’ve been doing prior to this point), programs are basically lists of instructions to the computer that define data (via objects) and then work with that data (via statements and functions). Data and the functions that work on that data are separate entities that are combined together to produce the desired result. Because of this separation, traditional programming often does not provide a very intuitive representation of reality. It’s up to the programmer to manage and connect the properties (variables) to the behaviors (functions) in an appropriate manner. This leads to code that looks like this: So what is object-oriented programming? As with many things, it is perhaps understood most easily through use of an analogy. Take a look around you -- everywhere you lo

Procedural programming Back in lesson 1.3 -- Introduction to objects and variables , we defined an object in C++ as, “a piece of memory that can be used to store values”. An object with a name is called a variable. Our C++ programs have consisted of sequential lists of instructions to the computer that define data (via objects) and operations performed on that data (via functions containing statements and expressions). Up to now, we’ve been doing a type of programming called procedural programming. In procedural programming , the focus is on creating “procedures” (which in C++ are called funct

Explore this link on the map →

related reading