DEV Community

Cover image for 30 Seconds of C++
Bhupesh Varshney ๐Ÿ‘พ
Bhupesh Varshney ๐Ÿ‘พ

Posted on • Originally published at

30 Seconds of C++

So if you are looking forward to learn C++ in 2019, I present to you the 30 Seconds of C++.

A collection of STL (Standard Template Library) features of C++ which can be learned in 30 seconds or less.

What is it again? ๐Ÿง

30 Seconds of C++ (hereafter referred to as 30C++) is a collection of modern C++ STL features like algorithms, containers, etc combined into short C++ snippets that can be learned in 30 seconds or less.
Inspired by the 30 Seconds of Code

Why did you make it? ๐Ÿ˜ฎ

I personally find it hard to learn modern C++ (C++ 14,17) through numerous C++ tutorials which either have incomplete info or if you wanna go further you may find yourself browsing these websites for modern C++

The problem with the above 2 resources is that they sometimes give too much info overshadowing the simple things to understand and from a perspective of a "beginner" who has just started learning that can be frustrating.
Although both these resources are damn good if you have a basic understanding which 30C++ can give.

Why would I learn C++? ๐Ÿ˜’

No doubt languages like JavaScript, Python, Java are ruling the programming world currently but the undoubted presence of C++ in the top 10 languages prove that C++ is evergreen and its presence will never diminish.
Check out these blogs for detailed comparisons :

TIOBE Index C++

Although to not break your bubble C++ takes a ton of time to master & feel its true essence. (figuring out myself)

I myself use Python as my main language but over the years C++ has helped me become a better developer, even if you are new to programming, using C++ as your starter language will be a good choice.

Even if you're not learning C++ from Job point of view, it offers a ton of learning experience.
See 5 Reasons Why You Should Keep Learning C/C++

More Resources

Here are some of the resources (blogs) which I currently follow :

PS: avoid these if you are very new to C++

How will it help me? ๐Ÿค”

  • 30C++ includes all the modern C++ features & more of them are coming day by day.
  • It can help you learn modern C++ step by step without browsing through any lousy and confusing documentation.
  • Currently, some of the library headers available are :

    • <algorithm>
    • <list>
    • <stack>
    • <queue>
    • <vector>
  • Also learning modern C++ will surely help if you are seeking a professional career in C++.

  • If you are a CS Student then learning C++ will be surely helpful, Why CS students must learn C++ as their main programming language

  • All the Snippets are explained in an easy to understand lucid manner with a link to run the example code.

  • As quoted by Bartlomiej Filipek

    I am not saying that C++ is fantastic and you should abandon everything and just stick to it. If youโ€™re just starting itโ€™s good to have more options and learn different things. Even if youโ€™re a C++ guy already, itโ€™s vital to learn something new and improve.

30 Seconds of Knowledge ๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป

If you are lazy(like me) you can also learn C++ and experience 30C++ on your browser by adding this awesome web extension to your favorite browser built by Stefan Petrovic.
Know more about 30 Seconds of Knowledge

Weekly Series Announcement


So with the help of 30C++, we will be learning together modern C++ through a series of C++ blogs that I will be posting starting soon.

Contribute ๐Ÿ˜‹

If you would like to contribute check out some of the open issues :

Add new methods in different header directories #31

This is for first-time-contributors : Add functions which belong to a particular header file in its corresponding .md file inside the header folder. For example std::sort belongs to algorithm header file, so make a new file inside the algorithm directory while maintaining the CONTIBUTING guidelines and formats.

See todo.txt file in different header directory to see which of the methods have not been implemented yet.

Add Run Code Links in existing code snippets #36

Add Runnable links of the code below the example. Use link name Run Code which links to a Online C++ complier conatining the example code. Use Rextester as the Online C++ Compiler (If you have a better suggesstion please comment).

Follow below steps to generate the Run Code Link.

  1. Go to Rextester
  2. Copy or write the example code.
  3. Run the code (hit F8) , see if you face any problems
  4. Save the code with the followng title format <algo_name>_30-Seconds-of-C++
  5. A permanent link will be generated , copy that
  6. Submit a PR which contains the Run Code Link just below the example.

Comment any doubts, suggesstions.

develop weekly newsletter #38

Develop a weekly newsletter for sending random code snippets to subscribers.

Feedback ๐Ÿค—

If you like to suggest anything please open an issue or comment below.

Also don't forget to Checkout my website for more blogs.

Logo & Cover Image by: Shriam Kaushik

Top comments (30)

sandordargo profile image
Sandor Dargo

Nice to see other people doing C++ around!

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

Thanks ๐Ÿ˜™๐Ÿ˜™
I was actually kinda motivated by your posts on C++ too . ๐Ÿ˜‹

wunk profile image

There's def a big lack of of C++ on this site for sure lol
So many students get C++-traumatized due to the fact that C++ is still being taught in schools with C++98.

Thread Thread
bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

Because as i said it's sometimes not beginner friendly and students get a bad first impression of C++
I mean just look how much C++ created
That JavaScript V8 engine ๐Ÿ˜Ž

Thread Thread
wunk profile image

Pretty much every language that isn't C or C++ is built upon a C or C++ stack these days lol

Thread Thread
bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

Say JVM for example ๐Ÿ˜‚

twigman08 profile image
Chad Smith

I love this post. Great post and great to see some C++ love here. This site definitely needs more of it.

The biggest issue with people being afraid of C++ is honestly how it's taught in my mind. Universities have taught it completely wrong, introduce concepts wrong, and don't even teach proper C++. They teach it like it is just "C with classes." A lot of universities even teach that using the STL is bad and that it's slow and want you to go back to using it like it's C. I was told by a systems professor a few times that C++ could not be used in this class because it was impossible for C++ to do the things that were required (he was wrong of course...).

C++ was my first language and it is still my baby even though it is not my main language anymore. I sometimes still go back to c++ to make sure I still remember how to do a few things and brush up on modern C++. It definitely has made me a better overall developer.

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ • Edited

I totally feel you
there is one misconception that STL is slow, it's NOT
Instead it increases the productivity of the language

ojordann profile image
Osi Njoku

I find reading โ€œThe C++ Programming Languageโ€ by Bjarne Stroustrup (original C++ creator) is one best ways of learning C++.

Yes, itโ€™s a deep long read but you reap the rewards several times over.

He explains tough concepts in a simple way with a plethora of examples.

yechielk profile image
Yechiel Kalmenson

Thanks! I'm learning C++ to help support one of our components at work (I'm using this tutorial) and I'm finding the the more I learn the better I understand what goes on "under the hood" in the order languages in using.

This will definitely come in handy!

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

Sure happy to help ๐Ÿค—
I think skipped the modern C++ STL features.

michaelrice profile image
Michael Rice • Edited

I started programming with Microsoft QuickC (which should make it clear how old I am) and then tried to go further with it. Left me a little bruised and battered but have always wanted to come back to C and/or C++, so thanks for sharing!

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

I started programming with Microsoft QuickC (which should make it clear how old I am)

Seriously ๐Ÿคฏ
I guess I could learn from you

michaelrice profile image
Michael Rice

omg, not at all. I'm learning from you!

C was a tough first experience for me. still get anxiety every time I see an asterisk!!!!

kdraypole profile image
Kobe Raypole

Started college with a CSCI class that taught computer science principles in C++. I can confirm that C++ is not beginner friendly, but if you can push through, any other language will feel like a breeze!

eddyekofo94 profile image
Eddy Ekofo

Migrating from Java to C++ at work. Did some of it back in college, now I gotta get my hands dirty everyday with some C++. Excited and anxious also.

God bless

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

You to brother

guy profile image

Great post. I started out in C++, and even though I don't regularly use it in my work today, it helped me tremendously when moving on to other languages.

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ • Edited

Yes !!! Finally someone agrees
It's totally true

enockmashia profile image
Enock Mashia

From a guy who built a 3D Bomberman OpenGl game in C++, all I can say is... "IT'S WORTH IT".

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

Thanks ๐Ÿ™‚โ˜บ๏ธ
I would try to keep up ma pace ๐Ÿ˜‰

bhupesh profile image
Bhupesh Varshney ๐Ÿ‘พ

Surely they are invaluable
I will link the core guidelines page in future

Some comments may only be visible to logged-in visitors. Sign in to view all comments.