Articles & Books

50 terrible coding tips for a C++ developer

Whichever C++ article you read, it provides serious information, requires thoughtful reading — preferably with a cup of coffee. And what if you want to have fun? That's why I decided to write this humorous article with terrible coding tips. The main thing is not to confuse these tips with helpful ones!

50 terrible coding tips for a C++ developer

by Andrey Karpov

From the article:

I write articles about static analysis methodology and issues of creating high-quality code. But I wanted to fool around a bit. So please, welcome the article with 50 terrible coding tips. However, if you have more ideas how to create sh*tcode — share them in the comments. There's a chance that I'll post a new article and there might be 100 terrible coding tips smile. In case you don't understand why some tip is called terrible, click the {link}. If there is no link, let me know. I'll share a more detailed explanation.

Supporting new speakers and great talks

Two weeks ago Meeting C++ organized an event centered on sharing information on how to prepare and give talks. With the goal being to level the playing field for everyone but also make it easier to start speaking. You can watch the lightning talks and the panel online.

Supporting new speakers and great talks

by Jens Weller

From the article:

This event supports the ongoing call for talks of Meeting C++ and other conferences. So for Meeting C++ 2022, submit your talk until Sunday, June 12th! As conferences and life has changed over the last 2 years, Meeting C++ wants to give everyone interested in speaking a hand on how to get started and motivated. Scott Meyers did once share in the second part of his Meeting C++ keynote in 2014 some of his thoughts on "preparing materials for the modern age" and a few years later CppCon has hosted some classes for speakers to improve their talks. But not much has come available for the general public as information on how to create and give technical talks. With this event I aimed at producing a first set of tips and topics for interested speakers to view for inspiration.

Assignment for optional--Barry Revzin

Highly non trivial.

Assignment for optional<T>

by Barry Revzin

From the article:

Let’s talk about assignment for optional<T>. I realize this is a fraught topic, but I want to try to build up proper intuition about how assignment has to work, especially since the debate around this topic has been fairly underwhelming. This post will almost exclusively discuss copy assignment (i.e. the one that takes an optional<T> const&), since everything just follows from that...

Writing a sort comparison function--Raymond Chen

How do you do it?

Writing a sort comparison function part 1, part 2, part 3, part 4

by Raymond Chen

From the article:

I’ve noted in the past that a sort comparison function must follow certain rules, and if you violate those rules, very strange things happen. So what are some patterns for writing sort comparison functions that don’t break the rules?

Most of the time, sorting can be reduced to key comparison: From each element being sorted, you generate a sort key, and those sort keys are compared against each other...

Check Types with Concepts--Rainer Grimm

The series continue.

Check Types with Concepts

by Rainer Grimm

From the article:

Concepts are a powerful and elegant tool to check at compile time if a type fulfills. Thanks to static_assert, you can use concepts as a standalone feature: static_assert(Concept<T>)...

How can I synthesize a C++20 three-way comparison from two-way comparisons?--Raymond Chen

Flying to the future.

How can I synthesize a C++20 three-way comparison from two-way comparisons?

by Raymond Chen

From the article:

The C++20 three-way comparison operator <=> (commonly nicknamed the spaceship operator due to its appearance) compares two items and describes the result. It’s called the three-way comparison because there are five possible results: less, equal, equivalent, greater, and unordered.

Yeah, the name is kind of weird...