lefticus / cpp_weekly

The official C++ Weekly Repository. Code samples and notes of future / past episodes will land here at various times. PR's will be accepted in some cases.
The Unlicense
695 stars 26 forks source link

Writing C++ the Right Way #175

Closed lefticus closed 1 year ago

lefticus commented 1 year ago

We are in a golden age of C++ tooling, many of them are even free!

lefticus commented 1 year ago

We are in a golden age of C++ tools

If you are developing blindly, without any tool guidance, you are doing C++ wrong. Think of these tools like a backup camera in your car. Certainly you can back up without a camera, but having one gives you a second set of eyes, deeper into the action than is possible with your human eyes.

You need:

See more info about tools and specific compiler options and flags here: https://github.com/cpp-best-practices/cppbestpractices/blob/master/02-Use_the_Tools_Available.md

Using an IDE or plugin for your IDE can help integrate many of these things as well.

lefticus commented 1 year ago

Coming in episode 350

daixtrose commented 1 year ago
  • An organized testing framework

I find ut quite promising.

njk42 commented 1 year ago

Very useful summary @lefticus!

One comment/request for future content... I hope this is an OK to post this: Many (all?) of the testing frameworks mentioned on C++ Weekly as well as numerous online conference presentations, v-blogs, etc. focus primarily on UNIT testing. It would be awesome to learn about some "higher-level testing" frameworks (i.e. component / integration / system) or Best Practices for using these available unit-testing frameworks in a higher-level fashion.

JohelEGP commented 1 year ago

I suggest opening a new issue about "testing beyond unit tests".

laoshaw commented 1 year ago

Please some practical advice on fuzzing testing for c++ especially with g++(clang++ has its fuzzer lib but g++ does not, g++ is however quite ahead of clang++ on c++20)

ladislas commented 1 year ago

I find ut quite promising.

@daixtrose I really like it as well.

For our project, we started using Google Tests. But as we are doing embedded development, at some point we wanted to start running parts of our tests which are between unit tests and functional tests on the actual hardware.

We are using ut to do just that and we are very happy with the results

ladislas commented 1 year ago

@lefticus when you say:

As many compilers as you can

Does it make sense to try with different versions of each as well? Or is using the latest version enough?

lefticus commented 1 year ago

@lefticus when you say:

As many compilers as you can

Does it make sense to try with different versions of each as well? Or does using the latest version enough?

I would say latest version + whatever version you use for production. Often times that differs because of organizational constraints.