DEV Community

Cover image for Wanna learn a new language? Why not C++?
Muhimen
Muhimen

Posted on • Edited on

Wanna learn a new language? Why not C++?

Lately, I've been thinking to learn a new programming language to boost up my programming career. I already knew Python and C#. I use Python for my personal projects, Machine Learning and AI. And I use C# for game development. My life was going pretty well until I met my demon. "Competitive programming".

Why I choose C++?

As you all know, Python is a bit slower than most other languages out there. And in competitive programming, one of the most important part is to solve problems as fast as possible. And your program must finish running in a certain amount of time. If you can't you will get the annoying TLE error. As Python is slower than it's other competitors, most of the time I end up with a TLE error. Even my solution gets accepted, there is always a significant amount of time difference between the Python solution and a C++ solution. I remember one of my solutions to finish running in about 400ms. When I checked other submissions, I found out C++ solutions took 0ms. Keep in mind, the same algorithm was applied to solve the problem.

Why should "you" choose C++?

You may not be a competitive programmer like me. But that doesn't mean you have no reason to learn C++. There are 3 reasons that I found for you to learn C++.

1|| One of the top language in FANG

Alt Text
C++ is among the top 3 three languages that are widely used in FANG(Facebook, Amazon, Netflix, Google), the current tech giants. So if you are planning for a job in FANG, having a good knowledge of C++ can surely help.

2|| Rise of a new horizon

Alt Text
Suppose you are in a war. There are enemies in front of you constantly advancing towards to slaughter you. Luckily there is a gun with you. When you tried to pull the trigger, you found the gun has no ammo. What a mess!!! You got lucky again and found a fully loaded AK47 beside you. And started firing the enemies.

So, what I meant by this example? To be simple, your newly learn C++ knowledge can turn out super handy while you face difficulties solving problems with your primary language.

3|| It's fast!

Alt Text
As mentioned earlier, C++ is pretty fast. This might be a perfect reason for you to learn C++. Yes, the small-time difference might not be an issue for you if you are just obsessed with personal projects. But if you are like me, you will probably need a fast-running language to save your back.

(Not enough reasons for you? Read this Quora answer)

How to get started?

So, you decided to learn C++ then? AWESOME!! But the question remains how you can start learning C++. If you are like me who knows programming, it's not a huge deal. All the programming languages are the same in the core. Just the syntax differs. So, if you have the basic knowledge of any programming language, then you will need to check for the syntax and that's it!

Don't worry if you don't have any prior knowledge of programming. You can start from scratch. There is a ton of useful resources on the internet for you to start learning to program. If you are confused about which one to grab, here is a course that I will suggest.

And yeah, one more thing for the experienced programmers, you can try converting your previously written code to C++. This will be a great practice for you. Whenever you get stuck, you can just check for the syntax or the methods on the internet. That's it!

Until next time, goodbye.
Happy coding for you

Top comments (14)

Collapse
 
mburszley profile image
Maximilian Burszley

why not c++

Because Rust 😂

Collapse
 
readredready profile image
Charles Gibson • Edited

Verbatim my knee jerk response.

C++ seems nifty if you are trying to get a well paying niche job, but if you don't plan on entering the C++ workforce in the next couple years I can't imagine it would be more rewarding than learning Rust.

(Absolutely DO NOT take my response as expert opinion. I know nothing and have done nothing, it just seems like the future from what I've seen.)

Collapse
 
muhimen123 profile image
Muhimen

That's a good choice though

Collapse
 
robenkleene profile image
Roben Kleene

C++ has a reputation of being for legacy code bases, but that's demonstratively false, especially for graphics-intensive applications. The two most recent new applications to gain real traction in graphics-intensive fields are the Affinity line from Serif (released 2014) and Figma (released 2016), both have graphics engines written in C++.

There's a new industry-wide trend of calling technologies that are used for the most successful, new, bleeding-edge software "legacy". Calling C++ a legacy language is part of that. C++ will be legacy when new, important, software is no longer written in it. That's not true today, and since I'd personally consider Figma the most important new application of the last decade, I'd say the exact opposite is true.

Collapse
 
ziizium profile image
Habdul Hazeez

If I could like your comment like a million times trust me I will.

In addition, thank you for this statement:

There's a new industry-wide trend of calling technologies that are used for the most successful, new, bleeding-edge software "legacy".

If I could I'll make a poster out of it and show it to every beginner programmer that gets discouraged by reading "advice" on the internet that a programming language is not worth learning because it is "legacy".

I might as well add that if they want to work on a project it's best to do research on the domain-specific language, rather than asking on the internet something like "I want to develop a desktop application what language should I learn?". There is a high probability they will get responses suggesting the "new" and "trendy" technology.

Collapse
 
juancarlospaco profile image
Juan Carlos

I code Nim lang, it made me learn C, C++, JavaScript too, so yeah I think C++ is good,
but just not for me, I want the features of Rust, with Python-like syntax, speed of C,
and runs on the browser and interpreted.
:)

Collapse
 
muhimen123 profile image
Muhimen

That's really a high demand I might say. 😉

Collapse
 
silvether profile image
silvether

Hmmm, Rust, Go, Swift, ill pass on C++.

Collapse
 
virt12 profile image
virt12

Hello Muhimem. Pls I am creating EEG analysis desktop app in pyqt5. I have issues counting EEG signals peaks per 1 sec. Help me out. Share your contacts I will sent my files.

Collapse
 
qm3ster profile image
Mihail Malo

Conduct like this will not be tolerated.
The police are on their way.
Don't bother deleting your comment, it is in the database.

Collapse
 
muhimen123 profile image
Muhimen

😅

Collapse
 
delta456 profile image
Swastik Baranwal

I hope you know that you will learn C in C++ first.

Collapse
 
muhimen123 profile image
Muhimen

2 years ago when I first wrote my hello world program, that was in C. So, yeah!

Collapse
 
muhimen123 profile image
Muhimen

Consider joining our Discord server for any kind of help, or to help others.
discord.gg/ZvGcPjZ