Articles & Books

Using Monads in C++ to Solve Constraints: 4. Refactoring--Bartosz Milewski

Time for refactoring functional code! Bartosz Milewski concludes his intriguing journey about the application of Monads in C++.

Using Monads in C++ to Solve Constraints: 4. Refactoring

by Bartosz Milewski

From the article:

In this installment I’d like to talk about something that a lot of functional programmers swear by: Functional programs are amazingly easy to factorize.

Acting In C++--Anthony DaSilva Jr

You will find here an article about:

Acting In C++

by Anthony DaSilva Jr

From the article:

Because they’re a perfect fit for mega-core processors and they’re safer and more enjoyable to program than raw, multi-threaded, systems, I’ve been a fan of Actor-based concurrent systems ever since I experimented with Erlang and Akka (via its Java API). Thus, as a C++ programmer, I was excited to discover the “C++ Actor Framework” (CAF). Like the Akka toolkit/runtime, the CAF is based on the design of the longest living, proven, production-ready, pragmatic, actor-based, language that I know of – the venerable Erlang programming language...

C++ Best Practices: A Forkable Standards Document - Jason Turner

A forkable coding standards and best practices document for C++.

C++ Best Practices

by Jason Turner

From the book

It (C++ Best Practices) compliments books such as Effective C++ (Meyers) and C++ Coding Standards (Alexandrescu, Sutter). We fill in some of the lower level details that they don't discuss and provide specific stylistic recommendations while also discussing how to ensure overall code quality.

...

This document is based on my personal experiences. You are not supposed to agree with it 100%. It exists as a book on github so that you can fork it for your own uses or submit back proposed changes for everyone to share.

 

Using Monads in C++ to Solve Constraints: 3. The Tale of Two Monads—Bartosz Milewski

Bartosz Milewski continues to explain how to use Monads in C++.

Using Monads in C++ to Solve Constraints: 3. The Tale of Two Monads

by Bartosz Milewski

From the article:

The functional solution to our problem involves the combination of the list monad and the state monad. Mashing two monads together is not trivial — in Haskell this is done using monad transformers — but here I’ll show you how to do it manually...

Handling short codes (part I)--Andrzej Krzemieński

First part of a discussion about designing a type storing character strings of length N (known at compile-time and sufficiently small).

Handling short codes - part I

by Andrzej Krzemieński

From the article:

In my work, we often deal with codes [...] The initial choice was to represent them in programs by type std::string, a general-purpose type for storing sequences of characters. But, as with any general-purpose tools, they fail to take into account the particular usage cases which often offer room for improvements [...] The following is an attempt at the design of a type that would take advantage of the information that we are only storing character strings of length N, where N is sufficiently small (say, no longer than 8)...

Using Monads in C++ to Solve Constraints: 2. The State Monad—Bartosz Milewski

Bartosz Milewski continues to explain how to use Monads in C++.

Using Monads in C++ to Solve Constraints: 2. The State Monad

by Bartosz Milewski

From the article:

We all like making plans, but they are often contingent on the state of our finances. Such plans can be described by functions. In general, a financial plan is a function that takes cash and returns the result paired with the new value of cash. It can be described generically using a template...

Using Monads in C++ to Solve Constraints: 1. The List Monad -- Bartosz Milewski

Bartosz Milewski starts to explain Monads in his recent article.

Using Monads in C++ to Solve Constraints: 1. The List Monad

by Bartosz Milewski

From the article:

I am sometimes asked by C++ programmers to give an example of a problem that can’t be solved without monads. This is the wrong kind of question — it’s like asking if there is a problem that can’t be solved without for loops. Obviously, if your language supports a goto, you can live without for loops. What monads (and for loops) can do for you is to help you structure your code. The use of loops and if statements lets you convert spaghetti code into structured code. Similarly, the use of monads lets you convert imperative code into declarative code. These are the kind of transformations that make code easier to write, understand, maintain, and generalize.

So here’s a problem that you may get as an interview question. It’s a small problem, so the advantages of various approaches might not be immediately obvious, especially if you’ve been trained all your life in imperative programming, and you are seeing monads for the first time.

C++ Today: The Beast Is Back -- Jon Kalb and Gašper Ažman

A new O'Reilly book from two well-known C++ community experts, freely available courtesy of the makers of CLion:

C++ Today: The Beast Is Back

by Jon Kalb and Gašper Ažman

From the announcement:

Now that software development is shifting primarily toward mobile and cloud computing, the venerable C++ programming language is returning to the dominant position it held during the object-oriented boom of the 1990s. In this O′Reilly report, you′ll learn why C++ is once again the preferred choice across several diverse industries...

Table of contents:

Preface

1. The Nature of the Beast

C++: What’s It Good For?
 

2. The Origin Story

C: Portable Assembler
C with High-Level Abstractions
The ’90s: The OOP Boom, and a Beast Is Born
The 2000s: Java, the Web, and the Beast Nods Off
 

3. The Beast Wakes

Technology Evolution: Performance Still Matters
Language Evolution: Modernizing C++
Tools Evolution: The Clang Toolkit
Library Evolution: The Open Source Advantage
 

4. The Beast Roars Back

WG21
Tools
Standard C++ Foundation
Boost: A Library and Organization
Q&A
Conferences and Groups
Videos
CppCast
Books
 

5. Digging Deep on Modern C++

Type Inference: Auto and Decltype
How Move Semantics Support Value-Semantic and Functional Programming
No More Output Parameters
Inner Functions with Lambdas
Lambdas as a Scope with a Return Value
 

6. The Future of C++

Setting the Standard
Never Make Predictions, Especially About the Future
 

Bibliography

The Annihilation of Conceptual Integrity by Tony DaSilva

A commentary on the C++17 directions being discussed today at the ISO C++ meeting in Kansas, USA:

The Annihilation of Conceptual Integrity

by Tony DaSilva

From the article:

When a large group or committee is tasked with designing a complex system from scratch, or evolving an existing one, I always think of these timeless quotes from Fred Brooks: ... “Who advocates ... for the product itself -- its conceptual integrity, its efficiency, its economy, its robustness? Often, no one.” – Fred Brooks

... Like all the other C++ committee members, Bjarne is a really, really, smart guy. For the decades that I’ve followed his efforts to evolve and improve the language, Bjarne has always expressed empathy for "the little people"; the 99% (of which I am a card-carrying member).
In a world in which the top 1% doesn’t seem to [care] about the remaining 99%, it’s always refreshing to encounter a 1 percenter who cares deeply about the other 99 percenters. And THAT, my dear reader, is what has always endeared Mr. Bjarne Stroustrup to me....