All posts in "Expressive code"

auto + const + smart pointer = bad mix?

Published July 12, 2019 - 0 Comments
auto const smart pointer

const is a feature that has been appreciated by C++ developers for decades of good services, to make code more robust by preventing accidental modifications. Smart pointers have been around for a long time too, and simplified the life cycle of many objects along with the life balance of many developers across the years. auto is a […]

The Cons and Cons of the Hungarian Notation

Published June 21, 2019 - 0 Comments
hungarian notation

wMaybe wthe wheadline wof wthis warticle wgave wyou wa whint wabout wmy wposition won wthe wHungarian wnotation p. And maybe the above sentence does, too. Hungarian notation can mean several things in programming, but the common meaning is that it’s a convention to prefix the name of each object in code with a tag about its type. To […]

The Shortest Name There Is

Published June 18, 2019 - 0 Comments
underscore

The names with give to the objects in code are a fabulous tool to express our intentions for the next developer to read them. Especially with good names. But in some cases, the name of an object becomes a burden. It happens when that object doesn’t make much sense in the first place, but for […]

Should Private Methods Always Be Const?

Published June 14, 2019 - 0 Comments
Private methods

What is the job of a function? A function takes inputs and computes outputs based on them. And to clarify a function’s interface, we saw how important it was to clarify what its inputs and outputs are. There is a particular sort of function in C++ that use specific conventions to express their inputs and […]

Why You Should Separate Commands from Queries

Published June 11, 2019 - 0 Comments

This article is NWH, standing for Not Written Here. The concept of NWH is inspired from the NIH (Not Invented Here) syndrome which consists in refraining from using existing code from outside the company and reinventing the wheel every time. Just like it is good practice to look out for solutions developed elsewhere, we’re going […]

Write Your Own Dependency-Injection Container

Published June 7, 2019 - 0 Comments

This post focuses on the use of a design pattern to connect the modules of a codebase in a structured and testable way. This is a guest post from Nicolas Croad. Nicolas has been a professional developer primarily in c++ for most of a 15 year career. Presently working in real time graphics for the New […]

Better Macros, Better Flags

Published May 28, 2019 - 0 Comments

Today’s guest post is written by guest author Foster Brereton. Foster is a 20-year C++ veteran at Adobe, and a Senior Computer Scientist on Photoshop. He is also a contributor to the Adobe Source Libraries and stlab.cc. He can be reached at @phostershop on Twitter. Once thought of as a handy tool in the programmer’s […]

The Expressive Absence of Code

Published May 21, 2019 - 0 Comments

When we think about expressive code, we generally think about the code we write. But as I learned while watching Kate Gregory’s ACCU talk What Do We Mean When We Say Nothing At All?, expressive is also code that we don’t write. What does that mean? What do we mean when we say What Do […]

3 Types of Macros That Improve C++ Code

Published May 14, 2019 - 0 Comments
macro C++

Macros are bad, it’s a well known fact, they’re vestiges from the past that really, really don’t fit well with the ever-growing modernity of C++. Well, except the macros that are good, that is. There is a rule that says that every rule has its exceptions. It implies that this rule itself has exceptions too, […]

1 7 8 9 10 11 20