# What I’m reading lately: The Ring of Words

Yesterday, while our power was out due to Hurricane Isaias, I read Peter Gilliver et al.’s The Ring of Words (2006). Subtitled “Tolkien and the Oxford English Dictionary,” this is a fascinating collection of tidbits on the vocabulary of J.R.R. Tolkien’s legendarium.

# An obvious guideline on function-call style

Warning: This blog post is glaringly obvious!

# A Parody on Iolanthe

In 1880s Chicago, one Davison Dalziel — the thirtysomething proprietor of the Dalziel National Printing Company, the Chicago News Letter, and Dalziel’s Railway Advertising1 — saw his passions for theater, printing, and railway-advertising align when he produced A Parody on Iolanthe (1884).

# What is the std::swap two-step?

This blog post has now been more than a year in the making; it’s the one for which I was laying the groundwork when I wrote “What is ADL?” (2019-04-26). Since I used the term again the other day, let’s finally define it: What is the std::swap two-step?

# How to erase from an STL container

C++20 introduces new library functions std::erase and std::erase_if. Notice that I said “functions,” not “algorithms”: these are not implemented as generic function templates, but rather as a closed set of function overloads, scattered across the STL’s many container-related headers.

Why are these new C++20 functions implemented as a massive overload set, instead of as a single “generic programming”–style function template? …

# What I’m reading lately: ACOUP, Kitbashed, the Atlantic

Military historian Bret Devereaux has a blog called A Collection of Unmitigated Pedantry where he writes in-depth — very in-depth — dissections of pop antiquity such as Lord of the Rings, Game of Thrones, and Total War.

His “The Practical Case on Why We Need the Humanities” (July 2020) is perhaps the most morally important thing I have to recommend in this post, so I’m putting it first. But, when you’re done with that essay, check out:

• “The Siege of Gondor” (May 2019; parts I, II, III, IV, V, VI) …

# Decompiling GOET0580

This is a step-by-step description of how to extract the A-code source code of Mike Goetz’s 580-point Adventure expansion (taxonomized in the Adventure Family Tree as GOET0580).

# The Star Wars cellular automaton

You’ve probably heard of Conway’s Game of Life, a cellular automaton which produces intriguingly chaotic patterns from simple rules. (Stephen Wolfram would call it a “class 4 CA” as if that meant something.) This blog post is on another intriguingly chaotic cellular automaton known as “Star Wars,” which was discovered by Mirek Wójtowicz circa 1999.

# Lovecraft on Hitler

One of my cousins is a Trump voter. We don’t talk much in normal life, but we recently had what I would call a cordial debate via email. Here are some of his comments on Trump:

# Homeworlds Puzzle: Mini Doomsday Machine

Ray’s red homeworld is armed to a frankly ridiculous degree, but all for naught: Lee’s mini-Doomsday-Machine is almost complete and his victory is assured. …

# The Case of Willie the Wisp

As a kid, I’d sometimes read a story where one line has stuck with me over the years as the perfect expression of some archetype. I find myself wishing that other people knew these same stories, so that I could actually use these lovely shorthands.

# The “OO” Antipattern

For those who only read above the fold: I don’t say that all object-orientation is bad! OOP, especially classical polymorphic OOP, has a well-deserved place in real code. I’m going to talk about a very specific antipattern that I see with some frequency: the use of class for things that should be simple free functions.

# Folding over operator=

Jonathan Müller posted a “Nifty Fold Expression Trick” the other day:

template<class F, class... Ts>
void reverse_for_each(F f, Ts... ts) {
int dummy;
(dummy = ... = (f(ts), 0));
}


For example, reverse_for_each(putchar, 'a', 'b', 'c') prints cba.

However, as I puzzled out each step of the process, I realized that there were several subtleties to this “simple” expression! …

# C++Now 2020: A C++ Magic Trick

Today would have been the first full day of C++Now 2020 in beautiful Aspen, Colorado… if not for coronavirus. I had had a good idea for a lightning talk — okay, maybe not as good as “Boost.Blockchain,” but — too good to lose. So I’ve recorded my lightning talk at home and uploaded it to YouTube! You can find it here.

# Connect Fifteen

Here’s a simple two-player card game you can play while stuck at home. I invented it sometime before 2003 — I would guess circa 1999. I call it “Connect Fifteen.”

# Default function arguments are the devil

If you frequently talk with me about C++, you have undoubtedly heard me say:

Default function arguments are the devil.

My position opposes the historical (early-1990s) style of the STL, of course; but I was recently alerted that it’s also in direct conflict with the (2010s) C++ Core Guidelines, specifically rule F.51. Since this conflict might, if unaddressed, lead people to think I’m wrong, I’d better address it. ;) …