20 February 2017

Modernize: Sink Functions

Passing Ownership of a resource to functions

One of the guidelines from Modern C++ is to avoid using raw new and delete. Instead, you should use a smart pointer, a container or other RAII object. Today I’d like to focus on so-called ‘sink functions’ that takes ownership of input parameters. How can we modernize code around such calls?

06 February 2017

How To Stay Sane with Modern C++

Complex C++

Have you seen my recent blog post with the list of C++17 features? Probably this is not the best measurement, but it got only ~30% of the average read (while other articles might get like 70, or even 90%). I am not complaining, the list is crazy and contains probably too many details of the new standard.

Another stat: C++ standard page count: from 879 pages for C++98/03 to 1586 for C++17 (draft)!

Do you need to learn all of that stuff to write good code?
How to stay sane in the C++ world today?

23 January 2017

Const, Move and RVO

Const Move and RVO

C++ is a surprising language. Sometimes simple things are not that simple in practice. Last time I argued that in function bodies const should be used most of the time. But two cases were missed: when moving and when returning a value.

Does const influence move and RVO?

09 January 2017

C++ 17 Features

C++17 features

In my last C++ summary (for 2016) I wrote that the draft for C++17 is the most important thing that happened. I’ve put a list of features of the new standard, and today I’d like to expand the topic so we can learn some more details.

31 December 2016

C++ Status at the end of 2016

C++ Status at the end of 2016

Another year and another C++ Status! It’s hard to believe, but it’s my fifth time I am writing this summary. And, as usually, C++ language is very alive. The biggest news for the year?

Of course, it must be: the final draft for C++17!.

What else have happened? See my full report below.

27 December 2016

2016 Blog Summary

Blog Summary for 2016

Another year of blogging! Was it good or bad? What’s the plan now? What were the most popular posts?

19 December 2016

Async Remote Book Review

Async Remote Book Review

As you might already know, I work remotely. That’s why I try to follow and read guidelines/articles that relate to that style of working. Recently, I got very curious when I saw a new book called “Async Remote” from the Arkency team. Let’s see what it offers.

Warning: the book is not only about remote! :)

12 December 2016

Debugging Tips Extra stuff

Debugging Tips extra

In June I’ve listed 11 tips that can save your time when doing debugging. As it appears, the article wasn’t that horrible :) I got a chance to update the content, extend the text and publish it on Visual Studio Magazine!

05 December 2016

Please declare your variables as const

Please declare your variables as const

I need to confess that for the last few years I’ve been a bit obsessed with the idea of making all variables const. Whenever I declare a variable in a function body, I try to think if I can make it constant. Let me explain why I think you should be doing the same.

21 November 2016

IIFE for Complex Initialization

IIFE for complex initialization of const variables in C++

How do you initialize your variables, especially the const ones? What do you do when the code for the initialization is complicated? Do you move it to other method or just write inside the current scope?

07 November 2016

Variadic Templates and a Factory Function

Variadic Templates

Variadic Templates from C++11 is probably not a feature that you use on a daily basis. But recently, I’ve come across one refactoring example where I’ve decided to give a try and apply variadics.

24 October 2016

Wrapping Resource Handles in Smart Pointers

Wrapping resource handles in Smart pointers, C++

Some time ago I covered how to use custom deleters with smart pointers. The basic idea is to specify a dedicated method that will be called when a pointer is released. One logical application of custom deleters might be resource handles like files or the WinApi HANDLE type. Let’s see how can we implement such thing.

22 July 2016

Code And Graphics in Mid 2016

Code And Graphics Blog

It’s summer! Hmm… actually it’s summer for almost one month now. This time, I don’t want to write about something heavy and related to programming. Let’s make a little summary of the first part of the year.. and also, I have a question to you - can you help me a bit?

07 July 2016

7 books that taught me how to code


As you might read in my recent post - coding without Google - I’ve started learning to program mostly from books. In the beginning, I read them from cover to cover (assuming I could understand them!) and recreated examples. It was an excellent time! In the post, I’d like to share my list of important books that taught me the base of my knowledge. Maybe you’ve shared similar titles along your learning path?

© 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.