Campbell’s Law

Back in 2017 I wrote about Goodhart’s Law, the notion that any measure used as a target, ceases to an effective measure. It stops being effective because those being measured learn to game the system in such a way that the measure is optimized rather than the desired result. The canonical example is standardized testing used to determine teacher compensation or school budgets. School administrators and teachers start teaching to the test making the “measure” effectively useless for its intended purpose.

Page Laubheimer and Kate Moran have a very interesting post about the closely related notion of Campbell’s Law, which says the more important some metric is in making a social decision, the more likely it is to be manipulated. Again, a prime example of this is standardized testing but there are many others that can affect any enterprise.

Most of the post is examples of Campbell’s law in action. Laubheimer and Moran end with a short section on some ways to avoid getting bitten by the law. The post serves as a useful reminder not to focus on some specific metric to gauge how things are going in your operation. If you tell people they need to increase some measure or another, you will get what you asked for but probably not what you wanted.

It’s a good post and well worth a few minutes of your time. It’s really easy to forget the lesson they bring but it’s important not to.

Posted in General | Tagged | Leave a comment

Measuring Network Quality in macOS

Sorry non-Appleheads, but this post will probably interest only Mac users. I’ve been running macOS Monterey since it was released but I just learned about an interesting new feature: networkQuality. It’s a command line utility to measure the quality of your network connection. Dan Petrov has a post about it that explains why, while it’s much like, say, fast.com, it also has a few advantages. Take a look at Petrov’s post for the details.

In the meantime, here’s a sample run from my laptop:

networkQuality
==== SUMMARY ====
Upload capacity: 6.400 Mbps
Download capacity: 51.507 Mbps
Upload flows: 20
Download flows: 16
Responsiveness: Medium (305 RPM)

There’s a manual page you can check for all the options and other information. It seems like a nice utility. My only complaint is the silly name with CamelCase name. It’s very un-Unix like and hard to type. Why not just call it nq or even network-quality? The capital Q is unnecessary and annoying. On the other hand, macOS will happily invoke it regardless of case so at least you can call it without the annoying capital Q.

Posted in General | Tagged | Leave a comment

Lisp at Kina

I haven’t talked about Common-Lisp on Irreal for a long time. That’s mostly because the majority of my recent Lisp programming has been in Elisp but I still love Common-Lisp and Scheme and am always happy when I find an interesting article about them. I particularly like articles that show how Lisp is being used to solve real world problems.

For a long time, the canonical example of this has been ITA Software, but there are others and azzamsa and his collaborators have a list. When he saw the list, Alex Nygren told them about his company Kina Knowledge that makes extensive use of Common-Lisp and its homegrown lisp, DLisp, that compiles to Javascript. That led to a nice blog post by vindarel that describes the Kina system and how Lisp fits into it.

You should read the post for the details but the TL;DR is that their technology stack is made up of Ruby/Rails, Javascript, Common-Lisp, and DLisp. Most of their front end is written in DLisp and is available to the end user. The back end is Common-Lisp that does much of the heavy lifting. And, as a bonus, Nygren uses Emacs for his Lisp coding and documentation. It makes sense; if you’re a Lisper, Emacs is a natural fit.

The post is well worth a read if you’re interested in how Lisp is being used today. There aren’t, I’m sure, enough Lisp jobs for everyone who wants one but they aren’t non-existent either. Paul Graham famously described Lisp as their secret weapon at Viaweb and related how they tried to prevent their competitors from finding out they were using it. Perhaps more companies will get the message and the number of Lisp jobs will increase.

Posted in General | Tagged , , | Leave a comment

Git History for Selected Text

Here’s a nice tip for finding all the commits related to some selected text in Magit:

I haven’t tried this in anger but it seems as if it could be useful when trying to figure out how a bit of code has changed over time.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Take That, Neovim

Posted in General | Tagged , | Leave a comment

Bozhidar Batsov Revists “Why Emacs”

Ten years ago, Bozhidar Batsov wrote a post entitled Why Emacs. It was a short essay on why he used Emacs, what was good about it, and what its shortcomings were. Ten years later, Batsov, like most of us, is a different person doing a different job.

Back then he was a programmer, mostly concerned with writing code but also writing a blog, (think), that he also wrote in Emacs so he could be said to be using Emacs for most of his text editing needs. These days he’s moved into management and no longer spends much time coding except for his OSS projects and the majority of his prose is written in Slack and Google Docs.

Still, Batsov continues to love Emacs and be one of the most prominant evangelists for it. He’s just written a retrospective on his post, Why Emacs: Redux. A lot of things haven’t changed: Emacs (and Vim) are still the premier way of editing text and Emacs’ extensibility is still unrivaled and the thing that sets it apart.

On the other hand, Emacs has not stood still. It has more packages than ever, it has rudimentary multithreading, a builtin JSON parser, good support for LSP, and, of course, native compilation. Emacs is definitely not standing still.

All of that is true but for me the real virtue of Emacs is power. The power to efficiently edit text, the power to extend it in virtually any direction I want, and the power to make it a Lisp-Machine-like operating environment.

Take a look at both posts. They’re interesting and a reminder of why we love Emacs so much.

Posted in General | Tagged | Leave a comment

Rant: Medicare Advantage Ads

This is a U.S.-centric post that probably won’t make a lot of sense to non-American readers. It does give me a new appreciation of the National Healthcare programs that many overseas readers have, though.


You know those Medicare Advantage ads featuring has-beens? We here at the International Irreal Headquarters find them enraging and always, always, mute them. They’re dishonest from the get-go because they imply they’re representing an insurance broker when in fact they’re merely a customer finder service that will route your call to the next broker on their subscriber list. People who know about these things say that the message itself is misleading.

It was bad enough when they used an ex-football player, an ex-sitcom actor, and an ex-boxer but when they bring in Capt. Kirk, they’ve gone too far:

I don’t know what the reaction to the other ads were—as I say, they get muted and ignored immediately—but the reaction to Shatner’s appearance seemed uniformly negative with a vibe of being betrayed by Capt. Kirk. I can relate. His ads get muted too.

Posted in General | Tagged | Leave a comment

Plain Org

For us Emacers, one of the longstanding shortcomings of iOS and, to a lesser extent, the Android ecosystem is the lack of an Emacs app. There are several Org-mode centered apps that allow you to perform various Org functions on your phone and sync the results with your computer through the cloud.

Álvaro Ramírez has another offering in this space. His Plain Org app provides a nice interface to Org’s task lists on your iPhone. Take a look at his post to see some animated Gifs of the app in action.

Until we finally get a native Emacs on iOS, apps like Plain Org will get us by. In the mean time, having a decent Org app is a boon. Most of what I want to do on my phone that involves Emacs involves some sort of Org file so having a good Org implementation that syncs back to my computer’s Org file is great.

Posted in General | Tagged , | Leave a comment

Hacking y-or-n-p

Marcin Borkowski (mbork) has a short post on how to make y-or-n-p return t when the user types Return. Check his post for the details but the TL;DR is that he temporarily extends the y-or-n-p keymap to have Return return as if y had been pressed.

It’s a fairly unique requirement but his approach works for other use cases where we want to add or change a key to an existing keymap. If you have such a need, take a look at mbork’s post.

As an aside, I should mention that mbork’s new book is finished and available. I read a draft of his early chapters and thought it was well done. Take a look if you’re interested in Emacs books.

Posted in General | Tagged | Leave a comment

Editing macOS Text Fields with Emacs

If you’re like me, you hate dealing with text outside of Emacs. Even those of us who spend as much time as we can inside Emacs have to interact with other applications. In my case, that’s mostly Safari. The problem with Safari is that its architecture doesn’t allow extensions that will call Emacs to edit text fields the way, say, Firefox does.

MacOS, of course, recognizes many of the Emacs keybindings but you can do much better. For many years, I’ve used the operating system’s ability to assign keys to editing functions to install a fairly comprehensive set of Emacs editing keybindings but while that helps with muscle memory, it’s not really like editing with Emacs. I’ve long wished for a way of popping into Emacs to edit the text fields from other apps.

Now, happily, my wish has been answered. Take a look at this video by dmgerman that demonstrates his Edit with emacs Everywhere package. It provides just what you’d want: if you’re in any text field in any Mac application, you can press a key sequence to put up an Emacs buffer in which you can edit the text in the field and then return the edited text to the calling app. The important thing here is that you’re not just using Emacs keybindings but using Emacs itself with all its power. Perfect!

The package depends on Hammerspoon to mediate with the OS. It’s easy to install and, of course, is more generally useful but even if it weren’t, giving us the ability to edit all text fields with Emacs is worth the price of admission.

Posted in General | Tagged | Leave a comment