Continuing the series! Feel welcome to dip in and weigh in on a past question.
Let's say I've never used C++ before. Can anyone give the run down of what the language does and why you prefer it? Feel free to touch on drawbacks as well.
Continuing the series! Feel welcome to dip in and weigh in on a past question.
Let's say I've never used C++ before. Can anyone give the run down of what the language does and why you prefer it? Feel free to touch on drawbacks as well.
For further actions, you may consider blocking this person and/or reporting abuse
Oldest comments (26)
It's the oldest language in this series by a good margin. In a way, it fits in more places and teaches you more about certain programming fundamentals than more novel languages.
I've never written C++ so I'll be following this thread with excitement!
Hit the comment subscribe button if you haven't! Not everybody knows how that works, but it's great for threads you care about.
Today I Learned. Thanks, Ben!
It is an old language that is still very popular. This means 2 things:
I have a love hate relationship with C++.
There's many things I could say about why I hate C++, but that's not what you are asking for.
Oh, well... May I change the question?
It is at least 20 years since last time I coded in C++. Maybe something changed; nevertheless, let me summarize my memories about it in two short phrases
I still remember the somersault with twist that I had to do to define a friend function of a template class...
It has been a long time, but some of the things that I remembered that I did not like
#includethat physically (rather than logically) embeds the included file. This has as consequences#ifdef INCLUDEDhack.use namespacein an header file, you pollute the namespace of whoever includes you"You must use the ugly #ifdef INCLUDED hack."
For this you have the non-standard "#pragma once", supported for most of modern compilers.
And really modern compilers don't even need that.
If you develop / deliver a library, you'd still better use old and nice
#ifndef.Yeah, quite a lot. I respectfully submit that you learn modern C++ before commenting — unless you, for example, think comments about life in Italy under Mussolini's rule are still valid. Maybe something has changed in Italy since 1943?
Well, it was pretty clear that my remarks were about the old version.
Although I have some difficulties to imagine how many of the defects I remember can be solved in new releases. Usually languages add features with time and drawbacks due to some issues in the original design (in this case, inheritance from C, obscure template syntax, automatic casting, type system C-like, ...) are difficult to solve because of the need of back compatibility.
Anyway, now I am curious and maybe I'll give a look to the new version, although I do not anticipate I will move to it soon.
I mainly use C++ for competitive coding or DSA practice. Its huge STL library support is what drives me to explore this language more and more.
able to write cross platform libraries that you can share almost everywhere - mobile, backend services, various desktop OS's.
IMHO, that is not completely true, to not to say absolutely not true.
With electron, react-native, react, and node, a js library might have further reach.
And what is the relation of that with C++ being "able to write cross platform libraries that you can share almost everywhere...". Each version of each library will need its own different C++ code base, more if they use UI, that is completely different and incompatible between platforms.
I just remember that one company that I worked at had an engine that would compute locations for items, and they wanted to share that engine between desktop apps and mobile apps. There was no UI in the engine. So, they ended up implementing it in a subset of c++ to be able to use the same source code for the engine in those disparate locations. I wasn't directly involved.
I was wondering if they would use js today.
One of my mentor who taught me C++ during my school days, used to say:
Other than that, It has been 10 years I last wrote C++ during my college days, Few years ago, I was watching a youtube video on C++ and didn't know about
autotype, and many other functionalities.I am not qualified enough to pitch for C++ but I am subscribed to following channels to keep me updated on the new features of C++ programming languages. So for anyone interested:
Horrible. That's like saying you're a bad builder because you're using machines for building a flat instead of putting bricks on top of each other.
No. He was not saying that. He was saying, you are not bad builder because you are using machines, you are bad builder if you are using machines, without understanding the basic concepts like how to put bricks by hand. Because sometimes, to get something done properly, you need to use your hands.
He was a great teacher. And often used these types of jokes to keep us interested in Maths and programming.
First of all, we were in middle-schools, (5-7 class) in mid-90s in India. He wasn't insulting us or the languages. This joke made us focused on practical stuff, not just whats in syllabus. We wanted to learn about basics of programming instead of just satisfied with examples at back of our books. And our syllabus didn't cover a lot of concepts.
And we conceptually wasn't wrong, Memory management in C++ is relatively easier than C, but the amount of control that C provided meant that your skills can directly impact the quality of resultant code.
That's okay, you should know the basics before you start using more advanced tools.
That's right, but on the other hand, C++ is much more complex language considering it has templates and other advanced constructs compared to C.
Best Language for Perfomarce, Low Level Programming, Memory Management, Constraint on Object Oriented Programming and a Good Standard Library with so many function.
Obviously there is a minimum requirement... some years of experience and a good knowledge of the language, in the other cases there are a lot of possibilities to do worse than other languages.
You can build IOS, android and desktop (mac, linux, and windows) with one code base and framework. This includes the UI!