Developer blog

Don‘t Make a Hash of it

April 25th, 2023

— by Arno Schödl

Composing streaming hashes has its pitfalls. Treat it like serialization to avoid them.

Read more

Meaningful Exceptions

March 31st, 2023

— by Arno Schödl

There are many APIs which on error throw exceptions. Or we write wrappers that turn error codes into exceptions. Is that a good idea?

Read more

An Actually Helpful Character Type

March 5th, 2023

— by Arno Schödl

As we have seen last time, having char8_t is not terribly useful. But we discovered that another character type is actually quite useful.

Read more

char8_t Was a Bad Idea

February 20th, 2023

— by Arno Schödl

We recently pondered whether to change all our chars to C++20 char8_t and decided against it, at least for now. At the face of it, adding char8_t seems straight-forward and appealing. There is already a char16_t and char32_t for UTF-16 and UTF-32 strings, so why not have a char8_t for UTF-8 strings?

Read more

Evil Reentrance

February 6th, 2023

— by Arno Schödl

Everyone knows parallel programming is hard, and we talk about it a lot. We talk much less about which I think of as the little brother of parallel programming and also a popular source of bugs in complex systems: reentrance.

Read more

The Merits of optional<T const&>

January 23rd, 2023

Passing function parameters by const& is very common. Now, what do we do if such a parameter is optional? std::optional does not allow T to be a reference.

Read more

When Order Matters

January 10th, 2023

— by Arno Schödl

Last time, I talked about inlining of single-call functions. In fact, there are situations where even for functions called multiple times, inlining functions into a larger one is beneficial.

Read more

Always Inline Single-Call Functions

December 30th, 2022

— by Arno Schödl

Conventional coding rule wisdom says that functions can be too long and then must be broken into shorter ones. In this post we discover distinct disadvantages when it comes to reading and refactoring which we have not seen discussed elsewhere.

Read more

Poor Man's Exception

December 19th, 2022

— by Arno Schödl

Let’s say we are performing a sequence of operations. Now, let’s assume each operation can fail, and returns false if it does. And if an operation fails, we want to abort and skip all subsequent operations. This post explores an alternative to if-cascades and exceptions to implement this.

Read more

The Value of Canonical Code

December 7th, 2022

— by Arno Schödl

Often there are different ways of how to write a particular piece of code. It is a good idea to have agreement on which code to pick. At think-cell, we call this the canonical solution. In this post we discuss how to find it and why this is important.

Read more

Properties (2)

November 30th, 2022

— by Volker Schöch

Meet the concept of hidden state: We define hidden state as state (information) that is represented and maintained in a data structure, but is not discernible by the user. Everybody who designs data structures frequently meets hidden state, whether they like it or not.

Read more

Properties (1)

November 23rd, 2022

— by Volker Schöch

Let's talk about a useful data structure for fonts. For the sake of this article, let's assume that a font consists of just a font face, a size and a flag for boldness. Turns out that even this simplified view of fonts is very useful in many use cases we encounter in our software.

Read more

tc::change

November 16th, 2022

— by Arno Schödl

Welcome to this blog of our development work at think-cell. It will be mainly about programming in general and more specifically about C++. Our platforms are mainly Windows and macOS, with a bit of web development sprinkled in. We will write about anything that comes to our mind, architectural decisions, little nuggets of wisdom we found or rants about bugs in 3rd party software that leave us frustrated. I want to get started with a little utility that proved surprisingly useful for us and that has a bit more thinking behind it than is apparent at first sight.

Read more


Sign up for blog updates

Don't miss out on new posts! Sign up to receive a notification whenever we publish a new article.

Just submit your email address below. Be assured that we will not forward your email address to any third party.

Please refer to our privacy policy on how we protect your personal data.

Share