DEV Community

Discussion on: What do I need to go back to C++ in 2021

Collapse
 
pgradot profile image
Pierre Gradot

I recommand CMake as you build system, to generate either makefiles or nija files.

GCC or clang are both great.

CLion by Jetbrains is my favorite but it's not free nor does it have a community version. Visual Studio Code is quite good too (and it's free) and has plugins for everything.

I highly recommand this website for tutorials about modern C++ modernescpp.com/index.php/what-is-.... I see its on @sandor Dargo's list ;)

The main features for me in modern C++ (as opposed to C++98): auto, constexpr, lambda functions, std::function, std::variant, variadic templates, smart pointers, std::optional.

Do you think it is stupid to try to catch up on C++ on 2021?

You can't start with C++14 IMO.

Unit Test Libs?

I have used Google Test and Catch2. Both are good. I want to try out doctest, which seems to a fork of Catch2 that compiles much faster.

are there IDE tools where you can just generate the code on the .cpp file after declaring the signature on the .hpp file?

CLion can more or less to this: "create class" will generate 2 files. Declare the class in hpp, go to cpp and do "generate defintions" for all functions.

Are there cli tools that generates projects structures for you that are standardish?

As far I as know, there is no de factor standard project structure.

Collapse
 
vikkio88 profile image
Vincenzo

GCC or clang are both great.

any particular reason why some people seems to prefer clang over gcc around the web tutorials I have found?

CLion by Jetbrains is my favorite

man Jetbrains people are the best, pity that they dont have a community version, dont feel like throwing money at it just yet.

thanks for all the info btw

Collapse
 
sandordargo profile image
Sandor Dargo

I'm not sure if this changed... But when I used CLion without a license it quitted after every 30 minutes. Apart from that it was fully usable and taking a break every half an hour is not that bad :)

Thread Thread
 
pgradot profile image
Pierre Gradot • Edited

I have never used in clang in a real project for 2 reasons: I work on Windows and mainly for embedded projects.

From the few experiments I did, clang seems to have even better error messages.

You're welcome btw ;)