C is an old, small and efficient and very influential programming language. C++ is a huge extension set for C. Like let's take C and add to it every concept and every possibility ever invented in programming. It's technically a different language, but it's almost a proper superset. C# is Microsoft's answer to Java, it's like a next generation of languages focused more on portability and scalability rather than efficiency. C# and Java are based on C syntax, but they are different languages. Answer from klod42 on reddit.com
🌐
Reddit
reddit.com › r/c_programming › c vs c++
r/C_Programming on Reddit: C vs C++
May 4, 2015 -

What is the difference in the usage of C vs C++? Can C and C++ programs be interchanged, or are they separate languages? If I learn C++ would I know C?

Top answer
1 of 5
30

This is a really long answer because there's a lot of nuance in the situation; hopefully you will find some answers within.

The TLDR: They are effectively separate languages as used by their practitioners, and you won't really know one by learning the other even if some of the knowledge will transfer cleanly.

There are subsets of C and C++ that are essentially the same language. Their respective standards groups have compatibility between the languages as an explicit goal, though they are not perfectly synchronized so there tend to be places where new features have not been brought in from the other yet.

Many compiler suites provide C and C++ support via single compiler that switches how it works based on compile-time options. So, aside from a couple of assumptions in the type checking and symbol naming, the C-compatible subset of C++ compiles to machine code very much like what you would get by compiling that same code written as C via the C-mode compiler.

C has a mountain of legacy code in embedded systems, operating systems, etc. So its standard committee is very conservative in how they change the language, and compiler vendors are slow to move to newer versions. It's a very old language; all the ideas in C were well-developed in the 60s and the major distinction it has from its predecessors is a static type system and memory model that recognize the shift from word-oriented to byte-oriented addressing in the machines that the developers used. Look and feel and basic feature set were intentionally kept very close to B, which was in turn a mostly syntactic overhaul and simplification of BCPL, which was in itself a subset of CPL oriented towards machine-level bootstrapping of the CPL language at the University of Cambridge and University of London. The design of CPL itself started in 1963, based on the ideas in ALGOL 60 but aimed at a larger domain of programming areas.

C++ was an attempt to bring some newer ideas in programming languages (type-based abstraction, Simula-style objects, generic programming) to the C language. Because C structures are capable of encoding most compound data structures and can also contain references to code (via function pointers), the features of C++ were prototyped and initially implemented via a preprocessor to a C compiler. The new features just expanded into a particular encoding in C structures. They still follow a similar implementation technique, though modern compilers may find better code for it due to knowing more about the intent.

Bjarne Stroustrup, the initial and primary designer of C++, used the design criteria that you shouldn't have to pay a runtime cost for features not used by your program as a guide for how he integrated features into C++ atop of the base C language. He also held compatibility with C as a strongly desired feature. These guides to the development of C++ are probably the source of both its wide acceptance and the sheer weight of books on the "right way" to code in C++. It's very much an "a la carte language", by design, but one must be tasteful about which features are used and how they are used together.

Because the extensions of C++ over C focus on abstraction, or the idea of writing programs that hide (hopefully) irrelevant details of how they work from other programs that call them, a programmer that learns C++ first may well feel lost as to how to build things in plain C, as these are precisely the details that are quickly abstracted away. However, highly experienced C++ programmers will most likely have learned exactly how C++ features translate to C (which is practically prerequisite to knowing which features one ought to use in C++ when designing a library or other system from scratch) and will find a shift to programming in C less daunting but perhaps more irritating than to the novice C++ programmer. It can be quite frustrating to have powerful, time-saving tools taken away, even if the same ends can be achieved through a manual encoding of the same techniques.

On the flip-side, an experienced C programmer will have a leg up on the novice C++ user in understanding the costs and benefits of various C++ features, but may be tempted to avoid hiding the sort of details they are used to working with. Experienced C programmers learn a distrust of opaque code bordering on the neurotic as a survival mechanism, so exploiting features that hide things is very difficult to motivate. This would lead to a rather stilted style of C++ code and grumbling from fully-converted C++ coworkers, though, which is perhaps why many in the C++ camp strongly advocate learning C++ first.

One must also keep in mind that although most of the features in C++ have been around in programming languages since the late 60s/early 70s, it's taken quite a while to work out how the underlying concepts fit together in the engineering of systems. A lot of early "object-oriented" work, especially once "Object Oriented" became a silver bullet buzzword in the industry, ended up chasing bad analogies and led to poorly designed systems as a result.

More recent approaches to designing programs in C++ take advantage of a rising level of understanding among practitioners of both object oriented design as well as alternative approaches such as functional programming and type-generic programming. C++ itself has also advanced at a much faster pace than C (for various reasons it hasn't been used as widely in areas that require really long-term support, like OS kernels, as C has, which makes its practitioners a tad bit less conservative in language extension) and so today's C++ is markedly different in style (if not substance) than that of 10-15 years ago.

To wrap it up: both C and C++ are widely used, but the features of C++ beyond C are of the sort that can have a huge effect on the style of programs and what you have to know to understand them at different levels. An intermediate user of either language, unfamiliar with the other, will likely see a typical example of the other as rather foreign. Expertise at either can be both helpful and detrimental towards learning the other, depending on the situation.

2 of 5
27

The two languages are closely related with C++ being a direct descendent of C via way of "C with Classes", essentially just a series of additions to C. This was eventually developed further and split off into its own language to become C++.

Today, the two have diverged substantially, especially with respect to the situations they tend to be used in, and what is considered "good" or "proper" coding style in each. However, despite this divergence C remains almost a strict subset of C++ so it is possible to write C code and (as long as you avoid doing a few things) have it compile without issue using a C++ compiler. The reverse is not true. Short of restricting yourself to the subset of C++ that is also in C, you will not be able to compile C++ code using a C compiler.

That being said, modern C++ code looks substantially different than modern C code even though they share a similar past, as the language communities have developed very different philosphies. C++ code will generally use a higher level of abstraction than C code. You will often see C programmers much more willing to get down and dirty, so to speak, working at the bit and byte level, and performing manual memory management (although these can also come up in C++ as well). C tends to be used for very low level projects: firmware, operating systems, embedded software, ect. C++ is generally used at the application level on projects where performance is still desirable, but a higher level of abstraction is appreciated, such as video games and web browsers.

Which one you learn depends a lot on what you want to do. If you're interested in getting down close to the hardware, or value a compact and comparatively simple language I would start with C. If you want to get into application development or have no interest in low level software then definitely go with C++.

🌐
Reddit
reddit.com › r/explainlikeimfive › eli5: whats the difference between c, c# and c++
r/explainlikeimfive on Reddit: ELI5: Whats the difference between C, C# and C++
November 6, 2024 -

I took C++ class in uni for the credits for a semester, did well but never coded again.

Never learned the difference between all C languages and I know next to nothing about programming in general, but I am ok at math and logic stuff

🌐
Reddit
reddit.com › r/cprogramming › why just no use c ?
r/cprogramming on Reddit: Why just no use c ?
January 22, 2025 -

Since I’ve started exploring C, I’ve realized that many programming languages rely on libraries built using C “bindings.” I know C is fast and simple, so why don’t people just stick to using and improving C instead of creating new languages every couple of years?

Top answer
1 of 41
59
C has some serious shortcomings that make it impractical or uncomfortable to use for many tasks. I wouldn't want to do, for example, web development in C. As for improving C, that happens but extremely slowly. C is rather unique in that it is a foundational language for just about every computer on the planet from the microcontroller in your electric toothbrush to the largest supercomputers. There are tens or hundreds of compilers in daily use. Every change to the language upsets someone and takes years to get through the standardization process. This is not necessarily a bad thing, C should evolve very conservatively.
2 of 41
31
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. --Greenspun's tenth rule C is used a great deal, and has been for a long time. But to get it up to the level of convenience and rapid-prototyping capability of (say) Python, one would pretty much have to implement something like Python! (CPython, the reference implementation, is, in fact, written in C!) Python (mostly) doesn't segfault. It (mostly) doesn't leak memory. You can load new functions into the program while it's running. It's easy to accidentally segfault or leak memory or generally mess up a pointer and read or write memory where you didn't want to. That mostly doesn't happen in Python. Many things that have to be design patterns in C are built into the language. It has dynamic typing, iterators, hash tables, automatic array resizing, a garbage collecter, a large standard library. The stack trace almost always points you to exactly your problem, but in C, you might accidentally overwrite the information you needed to debug it! Compared to Python, C feels tedious. Of course, there are costs to all of that. Python seem slow and bloated in comparison. In practice, CPython projects get most of the best of both worlds, because the fast library code gets written in C, and the slow Python code just glues those libraries together. Still bloated though.
🌐
Reddit
reddit.com › r/learnprogramming › why do people still use c instead of c++?
r/learnprogramming on Reddit: Why do people still use C instead of C++?
May 25, 2021 -

I am a python user so I may not have all the information but why do people and especially big companies still use C instead of C++? Isn't C++ the superset of C so it is supposed to be better? Also OOP is literally booming everywhere while C is still procedural. I don't suppose that there is much speed comprise between the two, so is there a specific reason?

🌐
Reddit
reddit.com › r/c_programming › why do people use c over c++ and should i do so too?
r/C_Programming on Reddit: Why do people use C over C++ and should I do so too?
April 18, 2024 -

Why do people use C over C++?

If you can write C code in C++, what is the reason to not use C++ if it just has more features that you might want to use: smart pointers, vectors, templates ect. I've seen a lot of people use C over C++. The main examples I can think of are Linux and DWM window manager. I though that maybe it's because a lot of people write code, and it's just easier to use C because it's much more simple, but what is the problem with just googling the things that C++ provides and just use it instead? I've also seen solo devs use C so...

Should I use C over C++?
I've a casuall advanced beginer. I like to have controll over the resources the program uses because I think its' fun to try and find the most optimal way for the program to execute to achieve your goal. I genuenly use C++, but I don't really use any of it's features that I mentioned in 1-st paragraph. The only things I really use from C++ are std::cout and new, delete. I was wondering if I should switch to C instead. I've head that it is simplier than C++ because it has less features, but I'm a bit afraid I'm gonna miss some really helpfull features that C++ has that I will one day need. Writing C-like code in C++ feels like I'm procrastinating the decsision I have to make between the two languages.

🌐
Reddit
reddit.com › r/c_programming › what's the difference between c and c++?
r/C_Programming on Reddit: What's the difference between C and C++?
March 23, 2022 - Now in 2022 these 2 languages differ to the point that some lines of code of valid and standard C is frown upon C++ programmers (like managing your memory manually). ... Simplicity vs.
Find elsewhere
🌐
Reddit
reddit.com › r/c_programming › what are the differences between c and c++
r/C_Programming on Reddit: What are the differences between C and C++
August 30, 2024 -

Hello, i wanted to inquire about what the differences between C and C++. I'm familiar with the fact that originally C++ was C but with OOP and a few improvements, however i know that these really aren't the only the differences now. If anybody could explain comprehensively the differences or link to a resource that does it would be much appreciated.

Extra note: I'm familiar with C++ but not C

🌐
Reddit
reddit.com › r › learnprogramming › comments › 17bplf6 › why_use_c_instead_of_c
Why use C instead of C++? : r/learnprogramming
October 19, 2023 - A bunch of std::ranges and algrothims are way more readable than manually doing the forloops and such also you have higher abstractions which will almost 99% of the time result in faster and cleaner code than C. C requires doing everything yourself and you getting it right and better than the ...
🌐
Reddit
reddit.com › r/cpp › c vs “c with classes” vs “modern c++”
r/cpp on Reddit: C vs “C with Classes” vs “modern C++”
February 27, 2023 -

i regularly come into this sub and hear that C and (modern) C++ fit different use cases and are valuable in their own respective rights.

simultaneously, this sub also suggests that modern C++ is better than C with classes.

This would all be fine and good, except that we also all agree that C with classes is better than C.

So, my question is this: huh?

🌐
Reddit
reddit.com › r/learnprogramming › c, c++ or c#?
r/learnprogramming on Reddit: C, C++ or C#?
May 20, 2024 -

Hey,

I wan't to learn C# to use in Unity, but also to learn C++ to use for unreal engine at some point.

I know both languages derive from C, but I have no purpose of C at this point. I don't know if it'd make sense to learn anyway, to have that fundamental understandment.

I kind of just wanna get started in programming, and learn one language to stick with for a while, because I have a feeling that they are fairly similar in terms of concept, just different syntax, but I don't know what language to start with.

My proficiency at the moment are just python and javascript.

🌐
Reddit
reddit.com › r/learnprogramming › thinking of learning c or c++
r/learnprogramming on Reddit: Thinking of learning c or c++
August 3, 2023 -

So I've been studying web development for 1 1/2 years now, by following through the odin project, I've built my own web application that i use (markdown app) using react, created a cli tool to fetch data from a game using restful apis to diplay on the terminal since thats where i spend most of time on, a somewhat working chrome extension that tracks how much time and how many times you've visited a website, and I've also built an r/place clone using express and websockets, but now i feel bored of web development and want to dabble into more complex stuff like mid or low level programming languages like c or c++, i want to be classified a self taught software engineer and not soley just a web developer and dont want to be restricted to only web development, so the question here is should i be learning c or c++? Both of these are mid or low level languages right? And c seems to be much more simpler contrary to c++, does learning c have any advantages over c++ if i were to pick it instead of the latter?

Top answer
1 of 3
68
so the question here is should i be learning c or c++ Yes, there is great value in knowing a low level language. It'll teach you how things work closer to the metal, which can help you make more informed decisions when working at high level. Both of these are mid or low level languages right? They are both low level. C++ does give you higher level tools in addition, which you may or may not use depending on how low level you want to go. And c seems to be much more simpler contrary to c++, does learning c have any advantages over c++ if i were to pick it instead of the latter? Depends, on what your goal is. C doesn't have a lot of the nice things that make C++ easier work with. It makes it somewhat easier to learn, but also more difficult to use for building big things. If you are only interested in the hardcore low level stuff, C is fine. Otherwise, I would recommend C++. Especially since you will at some point have to deal with C libraries when writing C++, so you'll get your dose of low level C anyway. I believe C++ is more marketable also. A very important note, if you chose to go with C++. Use resources that teach C++11 or later (like learncpp.com). C++11 and later is basically a different language, which is much much nicer and much less "C with stuff on top".
2 of 3
27
C is one of the simplest programming languages we have out there and it has a small standard library that is easy to learn. C++ is probably the most complex programming language we still use today and it's standard library is quite complex. Valid C is (almost) always valid C++ so if you learn C you have a huge start on learning C++.
🌐
Reddit
reddit.com › r/cpp_questions › when is c better than c++?
r/cpp_questions on Reddit: When is C better than C++?
May 23, 2023 -

A former co-worker talked about how C++ is just better than C, since it has more functionalities and if memory is an issue (like in a micro processor) you just avoid including packages and write C code in your .cpp file.

But a co-worker at my new office instead had the mentality that why should we even bother with .cpp files if we are already 99% certain we’ll need to write everything in pure C.

I understand this forum might be biased but I would still like to know your opinions on the matter. When, if ever, is it better to code in pure C instead of C++?

🌐
Reddit
reddit.com › r/c_programming › don’t be mad, why do you use c vs c++?
r/C_Programming on Reddit: Don’t be mad, why do you use C vs C++?
March 7, 2025 -

Genuine question, I want to understand the landscape here.

Two arguments I’ve heard that can hold water are:

  • There’s no C++ compiler for my platform

  • My team is specialist in C, so it makes sense to play to our strengths

Are either of these you? If so, what platform are you on, or what industry?

If not, what’s the reason you stick to C rather than work with C++ using C constructs, such that you can allow yourself a little C++ if it helps a certain situation?

I read a post recently where somebody had a problem that even they identified as solvable in C++ with basic templating, but didn’t want to “rely” on C++ like it’s some intrinsically bad thing. What’s it all about?

EDIT: for those asking why I have to ask this repeatedly-asked question, the nuance of how a question is asked can elicit different types of answers. This question is usually asked in a divisive way and I’m actively trying to do the opposite.

🌐
Reddit
reddit.com › r/c_programming › why do i prefer c over c++?
r/C_Programming on Reddit: Why do I prefer C over C++?
May 14, 2018 -

When I decided that I wanted to learn I consulted in forums, coming to the conclusion that if I wanted to learn to program anything I should learn c++ (they said it was the most used language in the video game industry and other leading applications like Photoshop).

I read some recommended books, web tutorials, videos...and I always had the feeling that everything was more complicated than necessary (classes, inheritance, virtual functions, constructors, destroyers, processes that occurred under the hood and forgot to take into account, multiple ways to initialize variable-objects.

But the worst part of it was reading code from other programmers. Very difficult for me. I never found any source code commented enough to be understood by anyone other than the writer.

I decided to start programming my own projects. I started with a text editor that used the mswindows console API. Everything went well until I started making mistakes. Some errors were detected by the compiler. Some understood them but others (STL) did not. The worst errors are those that do not interrupt the execution of your program and that you do not understand why your program does not work as it should.

In the books there is almost no mention of how to debug your program. Debugging is not part of the language specifications. I think this is one of the biggest mistakes made by those who teach a programming language. There's not much literature on the subject either. There aren't many debuggers. Trying to follow step by step the execution of your program through the debugger to see what happens at all times is, in my opinion, the most effective. It was impossible when I hit the STL.

I decided then that to know what was happening to my program I had to use my own functions. I started to implement my own containers ( no templates), no inheritance, no virtual functions. Everything as simple as possible. And there was light. I finally figured out why Mr. Torvalds doesn't like C++.

I decided to look more closely at the C language. I read Dennis Ritchie's book. Then I read Mr. King's book, which for me is the best book. I discovered the simplicity of language. It has hardly changed over the years (not so with C+++). I also read about assembler, ABI and undefined behavior. I migrated my program from C++ to C and since then I have mastered my programs and not the other way around. I hope this will be useful to those who are just starting out.