Final Thoughts on the C++ Programmer's Mindset

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

Fifteen chapters, one rubber duckies mystery, and a lot of code later, here is where The C++ Programmer’s Mindset lands.

Profiling Your Code: Finding Bottlenecks With Perf and Benchmarks

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

You picked C++ partly for speed. Chapter 15 is Morley’s case for measuring before you touch anything. Premature optimization wastes time and adds complexity. Profiling tells you where speed actually matters and what is holding you back.

GPUs and Specialized Hardware Part 2: CUDA Kernels and SYCL

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

Part 1 covered GPU architecture and the gentle on-ramps (Thrust, OpenMP offload). Part 2 is where Morley shows what writing kernels actually looks like: CUDA for NVIDIA, then SYCL when you want one codebase targeting multiple devices.

GPUs and Specialized Hardware Part 1: Architecture, Thrust, and OpenMP

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

CPUs are general-purpose workhorses. Sometimes you need a different animal. Chapter 14 introduces GPUs and other accelerators. This first post covers the architecture basics and the “easy mode” paths: library abstractions and OpenMP offload. Part 2 gets into raw CUDA and SYCL.

The Problems of Scale: Threading, MPI, and Distributed C++

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

At some point, one CPU with a handful of threads stops being enough. Chapter 13 is Morley’s tour of what changes when you scale up: more cores, more processes, more machines. The rubber duckies app fit on a laptop. Real workloads often do not.

Reflecting on What We Built: Finishing the Rubber Duckies Project

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

Chapter 12 is the payoff moment. After chapters of file readers, regex parsing, and k-means clustering, Morley finally wires everything into one runnable program and then sits back to ask: what did we actually learn?

Implementing K-Means Clustering in C++ for Hotspot Detection

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 11 Part 2 is where Morley ships the clustering code. Theory from Part 1 becomes KMeans, compute_score, best_kmeans_cluster, and compute_clusters. Tests catch real bugs, including a longitude flip at the north pole that only shows up on round-trip coordinate conversion.

K-Means Clustering Theory for Geographic C++ Data

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 11 is the computational core of the rubber duckies project. All those file readers were building toward one question: where on Earth are these sightings clustering? Morley implements k-means from scratch. Choosing k and embedding geographic data correctly are the hard parts, not the iteration loop itself.

Finding Dates and Coordinates in Free Text With Regex

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 10 finishes the ingestion story. JSON and CSV were structured. Email reports are not. Morley builds a FreeTextReader using compile-time regular expressions from the ctre library to pull dates and coordinates out of unstructured .txt files.

Reading CSV and JSON Data With a Unified C++ Interface

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 9 tackles the first two file formats in the rubber duckies pipeline. CSV and JSON are solved problems with good libraries. Morley’s actual challenge is designing one interface that hides how each format gets parsed.

Building a Command-Line Interface for the Duckies App

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 8 is where the rubber duckies project gets a real executable named duckies. Morley builds a minimal but extensible CLI around Boost program_options, spdlog, and OpenMP. Even if you are the only user, he argues, --help pays for itself the first time you forget what flags exist.

Outlining the Rubber Duckies Challenge in C++

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Part 1 was theory. Chapter 7 kicks off Part 2 with a full project. Morley hands you a client brief, sample data, and then does the thing most tutorials skip: he thinks before he codes.

Reusing Code and Modularity in C++ Libraries

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 6 is where Morley stops talking about solving one-off problems and starts talking about what happens when other people (including future you) have to use your code. The whole point is simple: code only matters if someone can actually reuse it.

Data Structures (Part 2): Linked Lists, Maps, Sets, and Benchmarks

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

The back half of Chapter 5 is where Morley admits vectors are not always enough. Linked structures, ordered maps, and hash tables each trade something away. He also runs real benchmarks so you can see the gap instead of guessing.

Data Structures (Part 1): Memory, Vectors, Stacks, and Queues

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 5 is the payoff for Chapters 3 and 4. You know how algorithms scale and how CPUs read memory. Now Morley asks: what container actually holds your data, and does its layout help or hurt?

Understanding the Machine (Part 2): SIMD, Branches, and the OS

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Part 2 of Chapter 4 is where Morley gets hands-on with SIMD, shows how branch style changes generated code, and reminds you that the operating system sits between your pointers and physical RAM.

Understanding the Machine (Part 1): Processors, CPUID, and Memory

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 4 answers a question Chapter 3 raised: your algorithm might be correct on paper and still slow because the CPU spent half its time waiting on RAM. Morley gives a compressed tour of modern hardware so C++ programmers know what they are actually driving.

Algorithmic Thinking and Complexity (Part 2): Design Patterns and Hardware

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

The second half of Chapter 3 is a tour of algorithm design styles, then a hard turn toward what the hardware actually rewards. Morley’s message throughout: reuse known solutions first, then get clever only when you have to.

Algorithmic Thinking and Complexity (Part 1): Proofs and Big-O

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 3 is where Morley stops talking about what code looks like and starts talking about how fast it runs. Algorithms are step-by-step instructions that bridge a problem and an implementation. They are language-agnostic, which is why every serious programmer should know how to read, analyze, and write them.

Abstraction in Detail: Classes, Templates, and Traits (Part 2)

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1, Packt 2025)

Part 1 of Chapter 2 covered problem categories, standard algorithms, and functions as interfaces. This post finishes the chapter: functions inside algorithms, function objects, classes, templates, concepts, and traits.

Thinking Computationally: Algorithms and Modern C++ Practice (Part 2)

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1, Packt 2025)

Part 1 of Chapter 1 covered decomposition, abstraction, and patterns. This post finishes the chapter: what algorithms actually are, how to read them, and how modern C++ plus good engineering habits help you iterate faster on solutions.

Thinking Computationally: Decomposition, Abstraction, and Patterns (Part 1)

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1, Packt 2025)

Chapter 1 of Morley’s book is called “Thinking Computationally,” and it sets the tone for everything that follows. This is not a chapter about std::vector tricks. It is about how programmers break down problems, find structure in messy data, and eventually write code that fits.

The C++ Programmer's Mindset: A Book Retelling Series

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1, Packt 2025)

Most C++ books teach you syntax, containers, and maybe a few design patterns. Sam Morley’s book takes a different angle. It asks: how do you actually think when you sit down with a hard problem? The answer is not “memorize more STL headers.” It is computational thinking, paired with the specific tools C++ gives you to turn that thinking into working code.