User Tools

Site Tools


notes:cprog:fall2021:projects:oop0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:cprog:fall2021:projects:oop0 [2021/10/27 16:44] – [Backstory of C++ Programming language] zswartwonotes: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 langauges were being created for different purposes, but most of them had flaws. Some languages were easy to understand, but lacked the depth to accomplish more difficult tasks. Others had this capability, but were large, abstract, and very difficult to learn, thus leading people to create more with the goal of having a language that was reasonably difficult, but could also accomplish difficult tasks. +In the 1960s-1990s many computer programming languages were being created for different purposes, but most of them had flaws. Some languages were easy to understand, but lacked the depth to accomplish more difficult tasks. Others had this capability, but were large, abstract, and very difficult to learn, thus leading people to create more with the goal of having a language that was not too complex, but could effectively complete difficult tasks. This eventually led to a C language that was good for low level programming, and a SIMULA language that had a class system. C++ language was the creation of Bjarne Stroustrup that combined these two.
  
 ==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 data types. 
 Classes make it easier to work with data by providing users with the ability to create constructors, destructors, member data, member functions, and more. Classes make it easier to work with data by providing users with the ability to create constructors, destructors, member data, member functions, and more.
  
-==Methods== +==Member Data==  
-Methods are functions that belong to a class.  The two ways to define a function that belongs to a class are inside the class definition and outside the class definition.  In order to define a method outside the class definition, you must first declare it inside the class.  You can then define your function outside of the class by specifying the name of the class and following it with the "::" operator.+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 (Member Functions)== 
 +Methods are functions that belong to a class.  The two ways to define a function that belongs to a class are inside the class definition and outside the class definition.  In order to define a method outside the class definition, you must first declare it inside the class.  You can then define your function outside of the class by specifying the name of the class and following it with the "::" operator. These functions are meant to be used alongside member data.
  
 ==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's name.+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's name. Objects are introduced by declarations
 =====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://www.w3schools.com/cpp/cpp_class_methods.asp https://www.w3schools.com/cpp/cpp_class_methods.asp
 +
 +https://www.geekboots.com/story/10-interesting-stories-about-c
 +
 +https://www.tutorialspoint.com/difference-between-c-and-cplusplus
 =====Submission===== =====Submission=====
 I'll be looking for the following: I'll be looking for the following:
notes/cprog/fall2021/projects/oop0.1635353040.txt.gz · Last modified: 2021/10/27 16:44 by zswartwo