I am learning C++. I learned basics concepts and OOP. The main things peoples are working on are GUI and API development with the help of C++. My question is, as a C++ learner is it a must for me to learn these in C++, because there are other languages to learn and develop these concepts (GUI , APIs ...)?
I will try to answer this question from a Computer Science Educator point of view.
C++ is a tool
First and foremost, C++ is a tool. Like any other language, it's designed to make accomplishing certain types of tasks easier, but it always comes with a cost.
C++ tries to be usable almost everywhere with a great deal of flexibility. This inevitably comes with a cost of complexity. Some say it's the most complicated language out there (to know all the rules, not to accomplish certain tasks - this confusion leads to incorrect assertions that C and Assembly are more complex).
It can give you everything
Teaching C++ has its benefits. You can use one tool to teach pretty much everything there is - high level abstractions like generics, dependency injection with polymorphism, framework interactions, various package managing, resource acquisition and control, interactions with hardware in the lowest level.
It's convenient to be able to teach pretty much everything while using one tool. But it has its costs.
It is incredibly complex and makes some tasks disproportionately harder
Computer Science students have many reasons to learn a programming language. It is important to not only provide reliable information, but to also encourage them to explore the possibilities on their own. C++ makes it hard. Very hard.
Scott Meyers (a notable author from the C++ community) was once asked, what, in his opinion, is most lacking in C++. He said something among the lines of:
I am an author, so naturally I would want to know how is my book selling. I need to fetch those information from some online source, so in C++ I... yeah...
Okay, forget networking. I have the data and I want to display them in a nice chart, so in C++ I... yeah...
C++ does not have many of the common (some would even say fundamental) features that are expected to be bundled in the language. Most students will be way more amazed by easily making some simple GUI application than by creating a console game for the 5th time. There is still no networking or GUI application in standard C++, and C++20 is almost implemented by the Big Three compilers.
Not everything can be solved by a third party library
Some would argue that third-party libraries exist for a reason. What's the problem with introducing a simple dependency and using it? After all, every programmer should be aware of such possibility and get familiar with project dependencies.
Except for the fact that C++ makes it incredibly hard to bundle additional dependencies. It was designed before Internet-aware package managers were a thing. Some decisions have been made that made sense during that time. But new tools were being created and integration reached a new level. Multiple times I had to mentally sigh when I was asked by a student why it takes 4 hours of researching accompanied by trial and error to install OpenCV with CMake, while in Python it takes one
pip command. The situation is bad and it's unlikely that it'll improve.
Every tool has its purpose
Every tool has its purpose and while C++ may as well be an academic language, I do not believe the pros outweight the cons in terms of learning programming. Make a distinction that is already omnipresent - don't use one tool to do everything, even though such a tool can be used with everything. Want to learn programming and get hooked? Chances are that Python, Kotlin, C# or TypeScript will be much more engaging and pleasurable experience. Want to start with or migrate to low-level language? Choose C or C++, but remember - nowadays C++ is not really used as a "just more powerful C". The "modern" part of it is more common and it's not really a tool used to primarily interact with hardware directly. Its aim is to provide a high level of abstraction with almost zero-cost overhead. This comes with complexity.
What to choose, then?
Ultimately, this is your question about your situation. You have learnt some basics of C++, good. It's not bad to make a transition to another language, nor is it bad to stay with C++. Ask yourself whether you're enjoying C++. If yes, try to delve deeper. If not, make a change. A programmer ough to know more than one tool, so learning more languages is inevitable.
A word of disclaimer - I have been programming in C++ for almost ten years. It is (and has always been) my primary language. I am engaged in both business solutions and education and, unfortunately, I more and more believe that my favorite tool (C++) is becoming more and more ill-suited for being an academic tool. Want to teach high-level? Use Kotlin, Python, TS, C# or Java (or other tools that make it easier by doing some work for you). Want to teach low-level? Use C.
Don't bother with the fact that C++ can do both of those things, unless you have a very good curriculum planned. "Can" doesn't mean "should".
There is nothing wrong with learning C++ as your first or main language. It's an extremely big and complicated language, but that's only if you want to learn everything about it. "Modern" C++, meaning C++11 or newer can actually be used as an elegant language to teach programming in. Try to find a book that teaches C++17: there is a lot in older C++ versions that has been improved and there are lots of tutorials out there that teach stuff you really should not use.
One of the main attractions of C++ is that you can write very high performance code in it. For example, C++ is really the language of choice for video games. But that's mostly for the deeper stuff, the actual video stuff. If you're interested in GUI applications you can use C++ but you don't have to. In your case I would let the choice of language be dictated by the platform you want to code for. If there is a de facto standard, use that.
As a software developer, I used C++ on several projects.
- First I learnt C.
- Then on the first C++ project I learn encapsulation.
- Then on the third C++ project I learn some more.
- Then on the forth C++ project I learnt Eiffel. In Eiffel I learnt polymorphism, inheritance, generics (templates), return type covariance, etc. ...
- I then learnt how to do these in C++.
- Then realised that C++ is a bad idea: It has some improvements to C, but also a load of blot, that gets in the way.
I wish I had learn Eiffel first, it is a much quicker language to learn. It is quicker to learn Eiffel and then C++. Eiffel is also a much quicker language to program in. And compiles to programs of similar speed to C++: faster for big complex programs, slower for simple programs (but not much).
- Learn to program: Eiffel, Lisp.
- Use a high level language for most jobs.
- Use a hybrid of languages when you need to do low-level stuff.
Eiffel, or if you must
C, for speed. There may be others.