C versus C++: The Differences

C and C++ sound alike from their names, but many differences exist between them. C, developed in Bell Laboratories approximately 1969, is driven by a fixed set of items; "items" being used in general, outside of programming. This means the more code exists in C, the more operations are performed on existing items. This gives the user more control over what is done to those items, though the number of available items are limited. C thus concentrates on steps; in C's case, computational steps are elaborated upon. C consequently lacks focus on states and behaviors, curbing those that can be added to any one system or group; "system" and "group" are used in their general senses here. C also therefore does not support changes in properties or procedures or bundling properties within one unit: if one wishes to change automobile into a set of cars and mopeds, or encapsulate cars and mopeds into automobiles, neither can be done in C. Last, one cannot have one item inherit another's properties, e.g. if one creates moped after car and car has color red, one must set that color in moped. In general, the more detail is given to how, something is done, the more C becomes viable for use.


C++ was developed around 1979 by Stroustrup and is object-oriented: it centers around items with states and behaviors, "object" used in the programming sense, and "items" used in the general sense. Being item-driven, it possesses a larger repertoire of items than C; said items communicate with one another. C++ is thus capable of object inheritance: cars, for example, can share color red with new item mopeds. Items in C++ are encapsulated in similar groups, e.g. automobiles would include cars and mopeds. Also, one item can be changed into another. For example, a set of given cars can be divided by all-wheel drive, or engines operating on both both front and rear wheels, front-wheel drive, or engines operating on only the front wheels; and rear-wheel drive, or engines operating on only the rear wheels. C++ works with a fixed amount of items to create more items, though procedures of those items are fixed. In short, the more what is done is a concern over how it is done, the more usage of C++ becomes viable for use.

Sources:

1.https://cs.lmu.edu/~ray/notes/paradigms/. Retrieved 24 February 2022.

2.https://study.com/academy/lesson/secure-programming-purpose-methods.html. Retrieved 24 February 2022.

 

3.https://www.bmc.com/blogs/polymorphism-programmin. g/. Retrieved 24 February 2022.

 

4.https://www.educba.com/c-plus-plus-double/. Retrieved 24 February 2022.

 

5.https://www.google.com/amp/s/stackify.com/oop-concept-for-beginners-what-is-encapsulation/amp/. Retrieved 24 February 2022.

 

6.https://www.tutorialspoint.com/difference-between-c-and-cplusplus. Retrieved 24 February 2022.

 

7.Johnson, Ralph (August 26, 1991). "Designing Reusable Classes" (PDF). www.cse.msu.edu. Retrieved 24 February 2022.

Comments

You must be logged in to post a comment.