intermediate

Design Patterns VS Design Principles: Observer, State and Strategy

Do you know about them?

Design Patterns VS Design Principles: Observer, State and Strategy

by Jonathan Boccara

From the article:

In this series of articles on design patterns and design principles, we analyse how the 23 GoF design patterns relate to the 9 GRASP design principles.

In a previous article, we classified the GRASP patterns like this (excluding “Managing complexity”).

The study we perform in this series is helpful to understand better both the GoF and the GRASP, with the goal of taking better decisions when it comes to organizing our code.

The GoF design patterns come from the seminal Design Patterns book. The GRASP design principles are explained in Craig Larman’s Applying UML and Patterns.

In this episode of the series, we examine the Observer, State and Strategy design patterns...

6 Ways to Refactor new/delete into unique ptr--Bartlomiej Filipek

Do you have that problem?

6 Ways to Refactor new/delete into unique ptr

by Bartlomiej Filipek

From the article:

In legacy code, you can often spot explicit new and delete lurking in various places and waiting to produce pointer-related issues. This blog post shows six patterns to improve that erroneous style and rely on modern techniques, especially unique_ptr and other helper standard types...

Dependent Names--Rainer Grimm

The series continue.

Dependent Names

by Rainer Grimm

From the articles:

A dependent name is essentially a name that depends on a template parameter. A dependent name can be a type, a non-type, or a template parameter. To express that a dependent name stands for a type or a template, you have to use the keywords typename or template...

Stricter Expression Evaluation Order in C++17--Bartlomiej Filipek

Do you know the rules?

Stricter Expression Evaluation Order in C++17

by Bartlomiej Filipek

From the article:

C++ has many dark corners and many caveats that can cause you to scratch your head in confusion. One of the issues we had until C++17 was the evaluation order of expressions. In this blog post, I’ll show you the new rules that we got in C++17 that made this complicated term much simpler and practical.

Here are the main points for today:

  • What’s the case with make_unique vs unique_ptr<T>(new T) in a function call.
  • What are the new rules for C++17?
  • Are all bugs fixed and now well defined?

Let’s go.