SIGAVDI #89: Apple Pie Funnel Cake Edition

Hello friends,

There’s a shiny red convertible in my garage. Some mornings I look out the window and it’s sunny and bright and I think, what a perfect day to go for a drive. Then I discover that since the last time I took the car out, one tire has gone soft, the battery is dead, and someone (me) deposited three milk crates of old Dr. Dobbs’ Journals on the seats for lack of a better place to put them.

I'll Trade Ya!

Hey there! Archived SIGAVDI letters are for newsletter subscribers only. All it costs to join (and unlock this post) is an email address! I'll write to you weekly-ish with a few interesting links, some updates, and some reflections on the intersection of software and life. And I'll respond to your replies! Whattya say?

A photo of Avdi Grimm

I don’t actually own a convertible, but that’s what this newsletter feels like sometimes. I want so badly to correspond to you but somehow I leave it juuuuuuust long enough to make it difficult to get started again.

Partly it’s the lack of time. I started with a new client a couple of weeks ago. It’s my first gig with a potentially long-term client in a few years, and that’s different. I am the sort of weirdo who gets excited about digging into hairy old Rails codebases. I feel like certain wheels that have been spinning too fast for too long are finally biting into good root-entangled earth.


Hey before I get too deep into ramblings, a quick item plug for a friend’s upcoming event: Eric Evans, author of Domain-Driven Design, is hosting a virtual DDD immersion training in December. This is a rare opportunity; up til now (pre-COVID) these classes were only available at in-person workshops.

In case you’re wondering, I’m not getting any compensation for plugging this class. Eric is a friend and his book is one of my all-time favorites on software design. I think this is a neat opportunity to learn the art of “supple design”. Seats are very limited, so grab one while you can.


I talked to a friend the other day about a company they were watching go through a re-branding makeover. My friend remarked on the new “statement of values” that emerged from this process: “These… are not the values I would have guessed were at top of mind for this organization.”

Maybe I’m cynical, but I think most mission statements and written values are exercises in self-deception. At best they are aspirational; at worst they are a form of gaslighting. “You definitely didn’t see the CEO subtly encouraging an unhealthy work/life balance, because that’s not what we do! It says so right here.”

It’s not that I think organizations do a bad job of putting their values into effect. It’s more a case of misunderstanding the natural direction of cause-and-effect. Complex systems don’t adhere to values; they exhibit them.

This is observable at the individual level. Goaded on by personal development literature, I have tried at various times to nail down my own personal values and mission. But what I’ve realized is, people aren’t what they claim to be; they are who they associate with.

I am J., who optimizes their life for novelty and delight. I am A., who feels the anguish in the world acutely, and constantly interrogates their own actions for injustice. I am C., who seeks ever more profound experience and wider consciousness.

The same goes for organizations. You can sink all the time in the world into committee meetings to hash out a mission statement, but you are ultimately who you are. Show me who a team attracts and retains, and I’ll tell you what they value.


Jess and I went to the St. Louis Zoo yesterday, a nice outdoor socially-distanced activity. I don’t recall ever watching hippos swim before, and it was by far my favorite part of the visit.

Hippos look for all the world as if somewhere back in their evolutionary history they wandered into a river, got comfortable, and just never quite got around to getting out again.

“Look, Hippo! We grew long necks to reach the highest leaves!” said the proto-giraffes.

“Nice effort!” said proto-hippo, from a mud-wallow.

“Don’t you want strong legs to run away from predators?” said proto-antelope.

“I’m tired just watching you. But you do you, man!” said proto-hippo, rolling a joint.

“Silly Hippo, you don’t belong in the water. You don’t even have fins!” said the proto-elephants.

“Yeah man, it’s cool” said proto-hippo, languidly. “I can walk on the bottom.”

The programming literature reads like fitspiration Instagram sometimes: Lean code! Clean code! Slim, lithe and limber code! What makes the world go ’round, though, is muddy code. Cozy code. Chonky code. Hippo code.


What’s good

At GitHub, we have normalized on a set of script names for all of our projects that individual contributors will be familiar with the second after they clone a project. We call them “Scripts to Rule Them All”.

Jon Maddox

A piece that I’d missed from five years ago. A useful pattern for standardization.

For software to be truly maintainable, it needs to carry as much of the explanation of the why along with it, and where the code itself cannot communicate that, the only place were an explanation doesn’t rot is where it’s completely bound to the implementation at that moment in time. And that’s exactly what the commit message is.

James Adam, “Two thoughts on maintainable software”

A good read on the importance of storytelling in commit messages.

One of the rules for developing DFD is that all flow must begin with and end at a processing step. This is quite logical because data can’t transform on its own.

Visual Paradigm

Confession: I’d never really paid attention to Data-Flow Diagrams before. But I kind of want to draw more of them now. There are some useful constraints here, as well as a nicely explicit acknowledgment of the human elements of a system.

There are many hurdles in interfacing with an external system. For example, the infrastructure layer must provide the means to communicate with another system that might be on a different platform or use different protocols. The data types of the other system must be translated into those of your system. But often overlooked is the certainty that the other system does not use the same conceptual domain model.

Eric Evans, Domain-Driven Design

(Emphasis mine) this is from the section in Domain-Driven Design on the anticorruption layer pattern. When I’d heard the name of that pattern I’d always assumed it had something to do with keeping out “bad” data. But it’s really about firewalling one mental model from another, and explicitly translating between the two. Or quarantining a system that lacks a consistent model at all. It’s about being intentional in preserving and cultivating your team’s shared ubiquitous language and understanding.


What’s new

That about wraps it up for this week. Thanks for reading,

Avdi

Featured Video Play Icon

That’s So Fetch

It’s time for another dip into the RubyTapas archives! In this third and last episode on Ruby’s #fetch family of methods, now free to all, we get into some advanced #fetch usage. Including: deep fetching, using the name of the missing key in fallbacks code, and why I never use the two-argument form of #fetch.

Read More

Re-Use SSH Config Inside Docker Containers with WSL2

Docker and WSL have been getting more and more chummy lately. The Docker Desktop WSL2 backend integrates Docker containers with the “official” integrated Windows/Linux ecosystem (boy that still feels a little weird to write…) and gains performance perks in the process.

However, I ran into some trouble recently getting SSH to work inside of a Docker container. As I’ve written about before, I like to bind-in my credentials from my host machine, rather than proliferating credentials into containers. When a container needs to SSH out to the wider world, that means binding in my .ssh directory from the host, e.g. with a docker-compose.yml:

    volumes: 
      - type: bind
        source: ${HOME}${USERPROFILE}/.ssh
        target: /home/${DEV_USER:-abapa}/.ssh

Only one problem: volumes mounted from the Windows side are mounted via drvfs, which by default projects all files as having mode 777 on the Linux side. And SSH will refuse to use certificate files that are world-writeable.

After a bunch of research and some trial-and-error, I found a solution that’s working right now (2020-10-24). Recent versions of drvfs allow NTFS-hosted files to have fake Linux-side effective permissions attached to them, via NTFS extended attributes. And the docker-desktop distro that Docker Desktop installs has this feature enabled:

PS> wsl -d docker-desktop
# cat /etc/wsl.conf
[automount]
root = /mnt/host
crossDistro = true
options = "metadata"

Notice the options = "metadata" line in /etc/wsl.conf.

So the trick was to open a WSL terminal in that distro and set the desired effective owner and file permissions:

PS> wsl -d docker-desktop
caroline:/tmp/docker-desktop-root/mnt/host/c/Users/avdi_000/.ssh# chown -R 1000:1000 .
caroline:/tmp/docker-desktop-root/mnt/host/c/Users/avdi_000/.ssh# chmod -R u=rwX .

These aren’t “real” file attributes, since Windows has a very different permissions model from Linux. But they get saved as file attributes and treated as the effective file permissions inside WSL distros with metadata enabled.

Notes:

  • -R makes the change recursive through directories.
  • User/group 1000 are a common default user/group ID for containers.
  • File mode u=rwX recursively sets files to readable/writeable by owner, and directories read/write/traversable by owner.
Featured Video Play Icon

Controlling superclass argument pass-through in Ruby

In Ruby class-based programming, superclass versions of subclass methods are always invoked explicitly using the super keyword. There are some nuances to using super though, particularly when it comes to passing (or not passing) arguments and blocks along to the base class. In this sample from from the RubyTapas archives, we’ll talk about some of those “gotchas”.

Read More

Featured Video Play Icon

Ruby Singleton Objects

Here’s another freebie from the deep RubyTapas stacks. This one is about a truth of object modeling that we don’t often talk about: not every object needs to have state. If an object has no state, there’s no need to have more than one of it. And for stateless objects, having a class just to generate a single instance may be superfluous!

Read More

SIGAVDI #88: Endless Beans Edition

Hello friends,

It smells like autumn. This will likely be an autumn without apple-cidering and hayrides, which makes me sad.

I'll Trade Ya!

Hey there! Archived SIGAVDI letters are for newsletter subscribers only. All it costs to join (and unlock this post) is an email address! I'll write to you weekly-ish with a few interesting links, some updates, and some reflections on the intersection of software and life. And I'll respond to your replies! Whattya say?

A photo of Avdi Grimm

I’m still on a dead-tree kick, so more book quotes this week…

Read More

Featured Video Play Icon

Alternative Ruby Symbol Literals

Periodically I take episodes from the RubyTapas archives and publish them for free. This episode from October 2012 is about symbol literals, and how you can use alternative quoting syntax to embed and interpolate any kind of character sequence in a symbol. And also: why you might not want to take advantage of this. Enjoy!

Read More