{"id":486,"date":"2022-09-22T20:31:53","date_gmt":"2022-09-23T01:31:53","guid":{"rendered":"https:\/\/random-musings.org\/?p=486"},"modified":"2024-05-09T12:20:55","modified_gmt":"2024-05-09T17:20:55","slug":"c-is-not-the-same-as-c","status":"publish","type":"post","link":"https:\/\/random-musings.org\/index.php\/2022\/09\/22\/c-is-not-the-same-as-c\/","title":{"rendered":"C++ Is Not The Same As C"},"content":{"rendered":"\n<p class=\"has-medium-font-size wp-block-paragraph\">This is something of a useless rant, in that few people care anything about the topic, and there is almost certainly nothing that will change as a result of my posting it.&nbsp; However, it may help me get it off my chest, which would be a good thing.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Throughout the Internet, I am constantly encountering titles, comments, notes, headers, and so on, with the text: C\/C++.&#8221;&nbsp; For example, if there is a listing of programming languages, you might see:<\/p>\n\n\n\n<ul class=\"has-medium-font-size wp-block-list\">\n<li>Python<\/li>\n\n\n\n<li>Perl<\/li>\n\n\n\n<li>Fortran<\/li>\n\n\n\n<li>Cobol<\/li>\n\n\n\n<li>C\/C++<\/li>\n<\/ul>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">In almost every case, C and C++ are together as C\/C++.&nbsp; The idea is that C and C++ are so similar that when you talk of one, you might as well be talking about the other.&nbsp; This is wrong.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/C_(programming_language)\">C is a venerable old language<\/a>, created by Dennis Ritchie back in the 1970&#8217;s.&nbsp; That&#8217;s in the Stone Age, as far as computers go.&nbsp; It&#8217;s an ancient language, but it&#8217;s still used in many places.&nbsp; The Linux kernel is written in C; many compilers are written in C, including some C++ compilers.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/C%2B%2B\">C++ is founded on C<\/a>, and has many similarities.&nbsp; However, it is a different language.&nbsp; C++ allows object-oriented programming; it has classes and methods and all sorts of stuff that C never had.&nbsp; C++ is useful in some applications, especially large and complex ones.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The uses of the two languages can overlap somewhat, but honestly each has its own niche.\u00a0 C is best for system programs, device drivers, anything that requires using the least amount of memory, or the greatest speed.\u00a0 C has been called a &#8220;high-level assembly language&#8221; because it allows you to take advantage of the computer&#8217;s hardware features.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">C++ is much larger than C.&nbsp; It takes up more memory, and it is generally going to run more slowly than C.&nbsp; C++ can be used for such things as highly complicated, large projects where the use of objects makes sense.&nbsp; You lose a little speed, but you make up for it in having your programs better protected against many types of errors.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">These two languages have their place.&nbsp; Neither is &#8220;better&#8221; than the other in general.&nbsp; But for God&#8217;s sake, quit lumping them together as though they were almost the same thing.&nbsp; They are not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is something of a useless rant, in that few people care anything about the topic, and there is almost certainly nothing that will change as a result of my posting it.&nbsp; However, it may help me get it off &hellip; <a href=\"https:\/\/random-musings.org\/index.php\/2022\/09\/22\/c-is-not-the-same-as-c\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-486","post","type-post","status-publish","format-standard","hentry","category-rants"],"_links":{"self":[{"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/posts\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":6,"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/posts\/486\/revisions"}],"predecessor-version":[{"id":972,"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/posts\/486\/revisions\/972"}],"wp:attachment":[{"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/media?parent=486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/categories?post=486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/random-musings.org\/index.php\/wp-json\/wp\/v2\/tags?post=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}