Sign in

The Pragmatic Programmers
By professional developers for professional developers.

A Story from the Musty Archives of Swaine’s World

In 1974, before ordinary folks could get their hands on a computer (or saw any reason why they should), Ted Nelson self-published a remarkable book titled Computer Lib. (Flip it over and you get a companion book, Dream Machines.)

On page after page dense with typographic eccentricities (“I write to be read aloud”) and skewed blocks of text, he explained computers and software to the lay reader as it had never been done before (or since).

The book looked the way it did partly because it was influenced by The Whole Earth Catalog (as well as Pete Seeger’s banjo book

Apply the IPD Solution to Employee/Manager Relationships

The Prisoner’s Dilemma from mathematical game theory makes for an interesting launching point for a discussion about cooperation. The Iterated Prisoner’s Dilemma (IPD) is even more interesting, and you can apply a solution for IPD to the employee/manager relationship. In fact, IPD can help you think about interactions with your manager as a non-zero-sum game — meaning both sides can win.

In the classic Prisoner’s Dilemma, two prisoners, A and B, are captured for their roles in the same crime. The police interrogate each separately, and neither prisoner can communicate with the other. Each has a choice of whether to…

Monotasking and Additive Versus Subtractive Solutions

  1. Can you spot the difference between the two bikes?
  2. What purpose do these bikes have in common?

Multitasking accelerates our eagerness towards additive solutions while monotasking supports subtractive thinking, research shows. This finding matters since adding rigid constraints to a complex system may make the system even more complex.

Subtractive thinking was always emphasized in agile. Simplicity was one of the four values in Kent Beck’s seminal Extreme Programming from the 90s. Further specified as, “the art of maximizing the amount of work not done,” it’s also one of the twelve principles in the Agile Manifesto, from 2001.

Faced with…

A Rust Programming Puzzle

How Can We Control Structure Layout?

Let’s see what you already know about structures in Rust and how the compiler handles them.

See if you can guess the output from the following program:

Click here to run the program on the Rust Playground.


You may be surprised by the result:

OneByte occupies 1 bytes.
TwoBytes occupies 2 bytes.
ThreeBytes occupies 4 bytes.

The OneByte and TwoBytes structures are occupying 1- and 2-bytes of memory — as you would expect. ThreeBytes has only 3-bytes of data but reports a size of 4 bytes.


By default, Rust makes no promises about the layout of structures, other…

Part 3

Navigating Future Ripples in Remote Work

We finally are nearing the end of the pandemic and the effects, or are we?

In 2020, the pandemic produced a big splash. However, the resulting ripples included a rapid shift to remote work, Zoom fatigue, feelings of isolation, stress built up from managing multiple responsibilities and activities at home, or just even finding a quiet place to work at home some days. Those were just the work-related ripples.

Ripples from a drop of water on a late afternoon
Ripples from a drop of water on a late afternoon

Beware Forced Transformation

Keep in mind that the pandemic represented a forced transformation in how we work. Those of us who help guide change management efforts never use “forced” and “transformation” together. Transformations take time to be absorbed by the organization and trying to push a transformation to completion…

How Does It Relate to The Game of Business?

Winning at the Game of School is different from actually learning the material.

To play the Game of School masterfully you must figure out the answer your teacher wants and provide the answer in the way the teacher wants to see it. Understanding that formula is crucial to getting partial credit on a question for which you don’t know the actual answer. Being good at the Game of School is very different from actually learning the material, and some people are good at one and not the other.

Years ago when I was a graduate student at Princeton University, one of our requirements was to present our research in a pre-general seminar. The…

Woz and the Founding of Apple

The year I moved to Silicon Valley to become a full-time editor and writer, Steve Wozniak crashed his private plane on takeoff from Scotts Valley Airport.

With only 50 hours of flight training, Woz was not certified to pilot the Beechcraft A36TC Bonanza, a notoriously challenging aircraft. But he had just become a millionaire due to Apple’s historic IPO, he had recently become engaged, and he had bought an airplane. He was flying high.

Well, not literally. The plane barely got off the runway before it stalled, dropped, crashed through two fences, and rolled to a stop in a roller…

Bargain Hunting for Games with the Beautiful Soup Library

I work hard, write code, and love my job. At the end of a long day, I also enjoy unwinding with a quick Xbox gaming session. I’m not a hard-core gamer, so things like subscriptions to monthly game services don’t really appeal to me, but finding good bargains certainly does. While PC gaming services like Steam alert customers when a wish-listed item is on sale, Microsoft doesn’t offer any sort of alert service. No matter — a quick Python script using the Beautiful Soup library and a Discord client will alert me when a game is on sale. …

Modern Front-End Development With Rails

Add JavaScript-Free Effects with the Turbo Library

A few months ago, Basecamp released Hotwire, their support tools for client-side development using HTML over the wire rather than JSON. These are the generic versions of the tools that power Hey. Hotwire consists of the already released StimulusJS, and Turbo, which is the successor to Turbolinks.

I’m very excited about these tools, and I discuss them at length in Modern Front-End Development With Rails (on sale now)!

In this post, I’m going to show how I used Turbo to add a couple of effects to the sample app used in the book, with basically no custom JavaScript.

In the…

Part II

A Python Approach

The first part of our modeling UEFA Euro 2020 article, in case you want to start there:

Modeling the Data

We are all responsible Python programmers (or at least pretend to be responsible Python programmers), so let’s implement the model as a class Team. A team has a name and strength. The team’s strength would be estimated by a subject-matter expert (SME): someone who knows European soccer better than an average Python programmer. If we cannot get hold of such an expert or cannot afford to pay them, let’s choose strength uniformly at random from the range 0 through 1. …

The Pragmatic Programmers

By professional developers for professional developers.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store