Wanted: state machines in the language

Our programming languages are often structured around the problem domain of compilers and the archaic (for most of us) task of converting things people understand to a thing the computer can execute.

Why don’t our languages have deeper support for the ways we reason about problem domains or the ways we struggle to reason. For example, why aren’t state machines and checking their sanity (or marking their unsoundness) a thing in pretty much any language?

The unhelpful answer is “because you can write a state machine in library code”. Which leads me to ask, why don’t we have popular state machine clones? Why is there no xUnit or Sinatra of state machines that is widely cloned to fresh and exciting languages?

The cynical answer is “because many programmers don’t want to think that hard”. The optimistic answer is that there’s room for someone to capture this problem space as well as xUnit did for programmer testing or Sinatra did for turning URL-like strings into method calls. You could be famous!

Van Halen ranked, atypically

Best songs that David Lee Roth talks over:

  • “Hot for Teacher”
  • “Panama”
  • “Everybody Wants Some”

Coincidentally, best use of Van Halen songs in film:

  • “Hot for Teacher” in the strip club scene of Varsity Blues
  • “Panama” in the joyriding/donuts scene of Superbad
  • “Everybody Wants Some” in the Hummer scene of Zombieland

Bon Iver discovers the Option key on his Mac

Someone just discovered all the weird glyphs you can make if you hold the option key and type random stuff!
Someone just discovered all the weird glyphs you can make if you hold the option key and type random stuff!

22, A Million, quick thoughts:

  • first track has a very Tune-Yards drums thing going
  • second track has a very 808s & Heartbreak thing
  • a few tracks in: each track is like Bon Iver doing someone else’s track from the past ten years, but with emo autotune
  • I like the background piano/horn tracks on “29 #Strafford APTS”
  • feels like the track sequencing demonstrates thinking through emotional/tempo pacing 👍
  • I really like the use of pseudo-sax harmony e.g. “____45_____”; slightly Ornette Coleman-esque
  • I like how a lot of the individual parts don’t fit together exactly right, but it still works

So what genre is this album? Neo-electro-ambient-folk-jam? Either way, it works!

On the albums of The Clash

Passing thoughts on the discography of The Clash that is not London Calling:

  • Brian and I had a conversation that randomly veered onto the Clash which prompted to me to listen to all of their studio albums
  • I have listened to London Calling a few times before, and recall some story about its producer encouraging them to go broader with the album so as to reach a wider audience; basically that it’s not much like their other albums
  • I enjoy London Calling, but I’m not sure what to expect from a categorical English punk band
  • I like the punk ethos of don’t wait for permission and build it yourself
  • I strongly dislike when punk music is simplistic shouting
  • Enough about me, let’s talk about the music
  • I was pleasantly surprised!
  • Their early albums don’t sound like the learned to play their instruments an hour before they started recording
  • They probably listened to music outside of their genre even before London Calling 👍
  • The albums after London Calling sound like they were trying to walk a line between keeping to their punk/ish origins and exploring integrating other genres into their sound
  • I should mention that their “Guns On the Roof” is exactly the same riff as The Who’s “Can’t Explain”
  • Would listen again!

This has been 🔥 takes.

We’re all adults here, but we’re not all mind readers

My favorite advice on the topic of method visibility (i.e. public vs. private) comes from Python creator Guido van Rossum. It goes something like “we’re all adults here” and says it’s not really a necessary thing for compilers/runtimes to hide methods from specific callers. Don’t go mucking around in other object’s implementations. I still think that’s mostly right.

Except, coming up to speed on a new code base is vastly easier when there’s some delineation of the waterline between an object’s public API which it expects other objects to use and its private implementation which it does not. It tells me a) the private methods are open for change and refactoring and b) below the private “waterline”, don’t bother going any deeper when spelunking to figure out how this program works.

In a new or strange codebase, every little bit of tractability helps.

Automotive enthusiasm and pragmatism

A few years ago, I was re-infected with enthusiasm for cars. I came upon One Car to Do It All and found a new reason to obsess over cars.

I read Car and Driver and Road and Track as a teenager. I was excited by the agency that cars bring (who isn’t?). It was a fun thing for me to nerd out about: technical specifications , comparing feature lists, and of course benchmarks! There was also a slight bit of romance to automotive journalism, ostensibly all writers traveling the country (or world) driving neat cars in beautiful places, often quite quickly.

Now, I’m taken by the history of specific manufacturers and how older models of cars became the current models. The technology and coordination needed to produce the modern car appeals to my technological side. The shape of cars new and old is a fun subjective conversation (e.g. are exterior about form or function?).

Most people do not view cars this way. They are automotive pragmatists. They want a car like they want a refrigerator or washing machine. The car is an appliance. It takes you from where you are to where you want to go without drama, in a modicum of comfort. The quality of the steering feedback, the particulars of the engine, or the predecessor of the car from two decades ago are nothing. The optimization is all around cost of ownership and utility.

(For the sake of symmetry I feel compelled to write another couple paragraphs on automotive pragmatism. But, there’s really nothing else to say. It’s pragmatic through and through.)

A curious thing happens when my car enthusiasm interacts with pragmatic car owners. Some of them will encourage me to talk about my enthusiasm. Mostly, it seems a little awkward, as though they’re afraid I somehow experience cars in a better way than they do. This is totally not the case, I can’t even really drive a stick!

In a way its not actually that curious. Car enthusiasm and the cars enthusiasts own correlate highly with elitism, which is by definition intimidating. But it does make me wish I had a shorthand for “I drive this car because its interesting to me, but I won’t judge your car, now tell me what you’re enthusiastic about that I don’t understand”.

Here comes GraphQL

GraphQL is gaining purchase outside of the JavaScript communities and this seems like a pretty good thing. Shopify and GitHub have jumped on board. Absinthe (Elixir) and graphql-ruby have caught my attention, though I haven’t had an opportunity to tinker with them yet.

That said, I like that GraphQL (and JSON API) let service developers focus on exposing a specific data model and optimizing access to it rather than taking a side quest through REST API design. For application developers, building screens and interactions with the data they need defined inline seems like a big win for contextual understanding.

As ever, the risk of using any kind of mapping layer, whether its objects and relational data or JSON object graphs to downstream service calls, is creating a naive, one to one mapping that create awkwardness and inefficiency.

Weaponized jerks

For a long time, the Central Intelligence Agency has had a guide to wrecking an organization by doing a few weird tricks at meetings. It recently came to light, and took hold as a meme, that this is the reality many people (non-spies) experience in their actual work life. Basically, some people work with weaponized jerks.

Which leads me to wonder, did the CIA invent these tactics, or did they discover them? Were they sitting around, talking about how big of a jerk John is at meetings and how he’s causing the Communists to win? And then they said to themselves, “hey, what if we had low-level agents just be like John?!”

And thus, the CIA made the world just a little bit less great.

Refactor the cow paths

Ron Jeffries, Refactoring — Not on the backlog!

Simples! We take the next feature that we are asked to build, and instead of detouring around all the weeds and bushes, we take the time to clear a path through some of them. Maybe we detour around others. We improve the code where we work, and ignore the code where we don't have to work. We get a nice clean path for some of our work. Odds are, we'll visit this place again: that's how software development works.

Check out his drawings, telling the story of a project evolving from a clear lawn to one overwhelmed with brush. Once your project is overwhelmed with code slowing you down, don’t burn it down. Jeffries says we should instead use whatever work is next to do enabling refactorings to make the project work happens. Since locality is such a strong force in software, it’s likely that refactoring will help the next bit of project work. Repeat several times and a new golden path emerges through your software.

In other words, don’t reach for a new master plan when the effort to change your software goes up. Pave the cow paths through whatever work you’re doing!