Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

C++ What is C++?

Malcolm

Administrator
Administrator
Staff Team
Code Plus
Company Plus
Hello Coders,

I was wondering what exactly C++ is? I was trying to write a 'What is..' post but just getting a little confused. Is C++ like a spin-off of C?
 
C++ was a Project started by Danish Computer-Scientist, Bjarne Stroustrup, while he was working at AT&T Bell Labs in 1979. It was originally titled "C with Classes" and wouldn't be released until 1985. One of the motivational reasons was because of Stroustrup's programming-experience for his Ph.D Thesis. Another one was because Stroustrup found that the Language, Simula, had really good features for large, Software-Development practices but was slow and BCPL(Predecessor to C and Go), was fast but wasn't good enough for large Software-Development practices.

It was around at the time that when Stroustrup began working at Bell Labs that he was having trouble trying to analyze the Source-Code of the UNIX Kernel. And so remembering his experience from his Ph.D Thesis, he then set-out to create C++(Again, at the time, called "C with Classes"), which was based off of C because it was fast, portable and a widely-used Language at the time(And to this day, C still is fast, portable and still widely-used).

Overtime, Stroustrup added Classes, default arguments and function name and operator over-loading. After C++ was released, more features continued to be added such as Namespaces and Exceptions.

One thing to note that at the time, when C++ was being developed, Ken Thompson(Co-Creator of UNIX and Go), had apparently tested C++ as it was being developed. This is a quote from him:
I would try out the [C++] language [at AT&T] as it was being developed and make comments on it. It was part of the work atmosphere there. And you'd write something and then the next day it wouldn't work because the language changed. It was very unstable for a very long period of time. At some point, I said, no, no more. In an interview I said exactly that, that I didn't use it because it wouldn't stay still for two days in a row. When Stroustrup read the interview he came screaming into my room about how I was undermining him and what I said mattered and I said it was a bad language.
If you're trying to understand what Ken Thompson was saying, he was essentially saying that for a long time, as it was being developed, C++ was relatively unstable. Whenever something new was going to be written, it just wouldn't work. Soon after, Thompson stopped testing the Language,

So, @Malcolm. There you are. A bit of history on C++. Anyways, as for your question, while C++ was designed to be an extension to C, C++ today is essentially now it's own Language but just a part of the C-Language Family, alongside C#.
 
C++ was a Project started by Danish Computer-Scientist, Bjarne Stroustrup, while he was working at AT&T Bell Labs in 1979. It was originally titled "C with Classes" and wouldn't be released until 1985. One of the motivational reasons was because of Stroustrup's programming-experience for his Ph.D Thesis. Another one was because Stroustrup found that the Language, Simula, had really good features for large, Software-Development practices but was slow and BCPL(Predecessor to C and Go), was fast but wasn't good enough for large Software-Development practices.
Very interesting! You're saying that Bjarne Stroustrup didn't release it because of his programming-experience for his Ph.D thesis? Little confused on this point. Or do you mean like these are the reasons he ended up releasing the language in 1985?

It was around at the time that when Stroustrup began working at Bell Labs that he was having trouble trying to analyze the Source-Code of the UNIX Kernel. And so remembering his experience from his Ph.D Thesis, he then set-out to create C++(Again, at the time, called "C with Classes"), which was based off of C because it was fast, portable and a widely-used Language at the time(And to this day, C still is fast, portable and still widely-used).
So he introduced C with Classes in 1985 because he was having difficulty understanding and or analyzing the source code of the UNIX Kernel?

So, @Malcolm. There you are. A bit of history on C++. Anyways, as for your question, while C++ was designed to be an extension to C, C++ today is essentially now it's own Language but just a part of the C-Language Family, alongside C#.
Awesome! Thank you! I'm not too good at holding the theory of programming so I'm trying to learn to keep it!
 
Very interesting! You're saying that Bjarne Stroustrup didn't release it because of his programming-experience for his Ph.D thesis? Little confused on this point. Or do you mean like these are the reasons he ended up releasing the language in 1985?
What I mean is that those are the motivational reasons for releasing the Language in 1985.I f he didn't release it then there would be no C++.

So he introduced C with Classes in 1985 because he was having difficulty understanding and or analyzing the source code of the UNIX Kernel?
Well, according to Wikipedia....Yeah, pretty much. The entire UNIX Kernel was first written in 1969, using Assembly(C didn't exist until 1972). Then when C was released, that's when the Kernel had been re-written in C. But mind you, this was a Kernel and Stroustrup probably didn't understand it as C was a completely new Language that he had never learned before(Unless, he did learn it in his own-time or class-time while studying for his Ph.D at Cambridge University in 1979. In 1979, C was now a few years old and only in the previous year[1978], did Brian Kernighan and Dennis Ritchie[Creator of C] release the first edition of The C Programming Language[Which today, still holds up well as a reference Book and learning Book for C]). And again, C++ was designed as an Extension to C. So, since it would be an Extension to C then other Programmers at Bell Labs at the time, if C++ ever got used in the Kernel, they'd probably be able to understand it(Mind you, at the time, C++ wasn't as big as it is now in terms of features. So it'd be similar to C but with things like Classes).

Unfortunately, that's as much info as I can give as to why UNIX was one of the reasons for Stroustrup creating C++. Wikipedia doesn't have much info on why Stroustrup made C++ for UNIX and I doubt the rest of the internet does either.
 
What I mean is that those are the motivational reasons for releasing the Language in 1985.I f he didn't release it then there would be no C++.
Okay, I understand now!

Well, according to Wikipedia....Yeah, pretty much. The entire UNIX Kernel was first written in 1969, using Assembly(C didn't exist until 1972). Then when C was released, that's when the Kernel had been re-written in C. But mind you, this was a Kernel and Stroustrup probably didn't understand it as C was a completely new Language that he had never learned before(Unless, he did learn it in his own-time or class-time while studying for his Ph.D at Cambridge University in 1979. In 1979, C was now a few years old and only in the previous year[1978], did Brian Kernighan and Dennis Ritchie[Creator of C] release the first edition of The C Programming Language[Which today, still holds up well as a reference Book and learning Book for C]). And again, C++ was designed as an Extension to C. So, since it would be an Extension to C then other Programmers at Bell Labs at the time, if C++ ever got used in the Kernel, they'd probably be able to understand it(Mind you, at the time, C++ wasn't as big as it is now in terms of features. So it'd be similar to C but with things like Classes).
Interesting! Hahaha I like a good history lesson every once in a while. Thanks for sharing @William! So are you saying that Kernel is now written in C?
 
Thanks for sharing @William! So are you saying that Kernel is now written in C?
No problem. Anyways, as for your questions....

The UNIX Kernel, when it was first invented in 1969, was originally done in the Assembly Language(Modern Kernels such as the Linux Kernel and BSD use Assembly as well). But, when Dennis Ritchie invented C while working at Bell Labs(Which was also were UNIX was being developed. Ritchie also worked with the UNIX Team), the UNIX Kernel would soon later be written in C but with a few droplets of Assembly here and there.

As for if C++ is in the Kernel, I can't really tell you. The Kernel was in fact, proprietary/closed-source so I can't just dig for the files of it online unless I worked on it at the time. The only information we have is that it was written in C and Assembly, that's it. We don't know if it also included C++ or FORTRAN in it.

But today, we do have the *BSD and the Linux Kernels which are both free-software(Free as in 'Freedom', not Free beer. Please check gnu.org for more info on 'Free-Software'). As we know, modern variants of BSD are typically written in C and Assembly but other variants contain Perl(OpenBSD) and Objective-C(Darwin, Apple's Kernel for MacOS and iOS). Were as Linux is just C and Assembly, but Operating-Systems that are based on Linux will have other Languages/Technologies in them such as Android(Java).
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom