This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:cprog:fall2021:projects:oop0 [2021/10/27 16:44] – [Backstory of C++ Programming language] zswartwo | notes:cprog:fall2021:projects:oop0 [2021/10/28 03:51] (current) – [Backstory of C++ Programming language] hhemler | ||
---|---|---|---|
Line 23: | Line 23: | ||
==Backstory and motivation of its creation== | ==Backstory and motivation of its creation== | ||
- | ----In the 1960s-1990s many computer programming | + | In the 1960s-1990s many computer programming |
==Differences between C and C++ language== | ==Differences between C and C++ language== | ||
+ | The main difference between the two is that C is a procedural programming language, whereas C++ is a hybrid language that can perform both procedural and object oriented programming. C supports built in data types, whereas C++ can support both built-in and user defined data types. C has 32 keywords, whereas C++ has 63 keywords, and C++ supports far more things in general than C. From a security standpoint, C does not support encapsulation so data can be manipulated by outside code meanwhile C++ supports encapsulation so the data is hidden. | ||
==Why C++ is still being updated today== | ==Why C++ is still being updated today== | ||
+ | C++ is still updated today because it is still so widely used today, due to its speed, programming capability, and its continued popularity in being used (even if a superior language did come out computer scientists would still have to learn that new language, and languages already written in C++ would still be written in C++). | ||
==Common uses of C++ in current times== | ==Common uses of C++ in current times== | ||
+ | C++ is most notably used in the creation of high performance programs, such as video games, operating systems, and the Google Chrome and Firefox web browsers. | ||
+ | |||
+ | ==Cool bug facts:== | ||
+ | C++ is a play on the ++ increment operator in C language. | ||
+ | |||
+ | C++ was originally called 'The New C'. | ||
+ | |||
+ | C++ has influenced other programming languages such as C# and Java. | ||
==OOP== | ==OOP== | ||
Line 43: | Line 50: | ||
OOP makes it possible to create reusable applications with less code and a shorter development time. | OOP makes it possible to create reusable applications with less code and a shorter development time. | ||
====Classes==== | ====Classes==== | ||
- | User defined types. | + | User defined |
Classes make it easier to work with data by providing users with the ability to create constructors, | Classes make it easier to work with data by providing users with the ability to create constructors, | ||
- | ==Methods== | + | ==Member Data== |
- | Methods are functions that belong to a class. | + | In C++, you can define data inside of classes for the sake of using them with member functions. Access specifiers can be used to determine where these variables can be called from, and which functions can call them. (This is further described down below) |
+ | |||
+ | ==Methods | ||
+ | Methods are functions that belong to a class. | ||
==Constructors== | ==Constructors== | ||
Line 91: | Line 101: | ||
====Objects==== | ====Objects==== | ||
- | Instances of a class. Creating an object of a class works almost exactly like initializing any fundamental type; simply specify the the type name, followed by your variable' | + | Instances of a class. Creating an object of a class works almost exactly like initializing any fundamental type; simply specify the the type name, followed by your variable' |
=====Program===== | =====Program===== | ||
- | Write a program that creates one of more of the following classes: | + | Write a program that creates one or more of the following classes: |
* rectangle | * rectangle | ||
Line 130: | Line 140: | ||
https:// | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
=====Submission===== | =====Submission===== | ||
I'll be looking for the following: | I'll be looking for the following: |