Partners: KDAB Whole Tomato Software CppDepend

06 November 2017

Enforcing code contracts with [[nodiscard]]

nodiscard attribute C++17

For my article series about C++17 features, I’ve made a separate entry about new attributes. At first sight, I thought that [[nodiscard]] is just another simple and a rarely used thing. But later I thought… hmmm… maybe it might be valuable?

One reason is that [[nodiscard]] might be handy when enforcing code contracts. That way you won’t miss an important return value.

Let’s look at a few examples.

30 October 2017

Better code understanding with Sourcetrail

Sourcetrail, review

Do you write code 100% of your job time?

I’m guessing the answer is no. Ignoring the whole management part, meetings, coffee, youtube, cats, etc, even if you’re sitting at your keyboard you’re not typing all the time. So what else are you doing?

The short answer: you’re probably figuring out what to write and where to add new features (and what to fix)… so you’re mostly reading and trying to understand the code.

There are tools to help you better understand code which are not just text editors. One of such application is Sourcetrail, let’s see what can it do for us.

Bonus!, read further to see details of our new giveaway :)

23 October 2017

Expressive C++ Coding Challenge Results

Expressive C++17 challenge Results

Three weeks ago with Jonathan from Fluent C++, we announced a coding challenge: link here.

Let’s meet the winner and discuss some of the best solutions

(Our choice is quite surprising! See why :))

16 October 2017

How not_null can improve your code?

not_null examples

One of the key points of modern C++, as I observe, is to be expressive and use proper types. For example, regarding null pointers, rather than just writing a comment:

void Foo(int* pInt); // pInt cannot be null

I should actually use not_null<int *> pInt.

The code looks great now, isn’t it? Let’s investigate what not_null (from the Core Guidelines/Guideline Support Library) can do for us.

09 October 2017

Cpp Con 2017 Notes

Notes from Cpp Con

Have you been at Cpp Con this year?

I haven’t, but still I plan to watch some good C++ talks. Can you help me a bit and add your notes?

25 September 2017

The Expressive C++17 Coding Challenge

The Expressive C++17 coding challenge

Let’s put C++17 in practice!

One of the good ways to do it is to take part in a coding challenge.
So together with Jonathan Boccara from Fluent C++ we invite you to participate in “The Expressive C++17 coding challenge”.

18 September 2017

C++17 in detail: Summary & Bonus

C++17 features, summary

The last post in the series about C++17 (STL utils) was posted on 4th September. It happened to be just two days before the final C++17 spec was approved! :)

C++17 is formally approved
2017-09-06 by Herb Sutter
herbsutter.com/2017/09/06/c17-is-formally-approved/

In this post, I’d like to make a little summary, and I also have a bonus for you :)

11 September 2017

Learning from bugs and PVS-Studio Team

PVS Studio Resources

Real life:

Fixed 1 out of 99 bugs in a project. 117 to go…

Have you experienced something similar? Although it’s impossible to write bug-free code, there are tools and practices to lower the rate of mistakes.

Today, I’d like to run through a gigantic list of freely available resources from the PVS-Studio Team who works with bugs analysis on a daily basis.

04 September 2017

C++17 in details: Standard Library Utilities

C++17 features, stl utils

The new C++ standard brings many useful additions to the Standard Library. So far we’ve discussed bigger features like the filesystem or parallel algorithms. Today, I want to focus on smaller, but also handy things.

For example, there are utils for handling type safe unions, replacement of void*, string searchers and much more.

28 August 2017

C++17 STL Cookbook Book Review

C++17 STL Cookbook Review

C++17 is on the way, and I’m glad to see more books that stay on the bleeding edge of C++ adaptation. Today I’d like to present a book that focuses on the Standard Library.

Is this another great book?

TL; DR: Yes :) But read more to see why :)

Plus I have a bonus: Q&A with the author and a giveaway.

21 August 2017

C++17 in details: Parallel Algorithms

C++17 features, simplifications

Writing multithreaded code is hard. You’d like to utilize all of the machine’s processing power, keeping code simple and avoid data races at the same time.

Let’s see how C++17 can make writing parallel code a bit easier.

07 August 2017

C++17 in details: Filesystem

C++17 features, simplifications

Although C++ is an old programming language, its Standard Library misses a few basic things. Features that Java or .NET had for years were/are not available in STL. With C++17 there’s a nice improvement: for example, we now have the standard filesystem!

Traversing a path, even recursively is so simple now!

31 July 2017

Blog summary for the first half of 2017

Blog Summary for H! 2017

See my blog stats and thoughts for the first half of the year.

24 July 2017

C++17 in details: Code Simplification

C++17 features, simplifications

With each C++ standard, we aim for simpler, cleaner and more expressive code. C++17 offers several "big" language features that should make our code nicer. Let’s have a look.

© 2017, Bartlomiej Filipek, Blogger platform
Any opinions expressed herein are in no way representative of those of my employers.
This site contains ads or referral links, which provide me with a commission. Thank you for your understanding.