Use of Weapons, Revisited

I just finished listening to Use of Weapons. I first read it shortly after it was published, and it remains my favorite book — well, maybe second to Excession — by Iain M. Banks (who is sorely missed), and one of my favorite SF novels ever.

Spoilers. Please, if you haven’t, go read the book.

First of all, after it finished and I had relistened to the last couple of chapters just to get them straight in my head, I immediately went looking for any essays about the end, and found this very nice one. What follows was intended to be a comment on this post, but WordPress.com wouldn’t cooperate so I’m posting it here.

I’d like to add my own thoughts which are a little counter to the writer of the referenced post’s wholly negative take on Elethiomel. First, he never tries to blurt out a justification for his actions to Livueta, despite many opportunities. Even in his own internal monologues he never tries to justify his own actions. Similarly, if anything Livueta remembers him more fondly than he remembers himself (at least before the chair). If he’s a psychopath, he’s remarkably wracked by conscience.

In an earlier flashback he wonders what it is he wants from her, and considers and (if I recall correctly) rejects forgiveness.

If we read between the lines, we might conclude that the regime to which the Zakalwes are loyal is actually pretty horrible. The strong implication is that Elethiomel’s family narrowly escapes annihilation only owing to their being sheltered by the Zakalwe’s. It has the feel of Tsarist Russia about it.

Elethiomel, for all his negative qualities seems naturally attracted to the nicer side in every scrap he ends up in. When he freelances in the early flashbacks, he’s not doing anything public, he’s quietly and secretly using his wealth and power to (crudely) attempt to do the kinds of things the Culture does.

The book is full of symmetries. If you’d like one more, the Zakalwes are “nice” people loyal to a terrible regime, whereas Elethiomel is a ruthless bastard who works for good, or at least less terrible, regimes.

So it’s perfectly possible that the rebellion he led was in fact very much a heroic and well-intentioned thing, but at the end, when it was doomed, he fell victim to his two great weaknesses — the unwillingness to back down from an untenable position (if he looks like he’s losing, he simply keeps on fighting to the bitter end) and his willingness to use ANYTHING as a weapon no matter how terrible. I think it’s perfectly possible that he did not kill Darkense, but was willing to use her corpse as a weapon because it gave him one more roll of the dice. What did he want to say to Livueta, after all?

I further submit that his final unwillingness to perform the decapitation attack in his last mission shows that he has actually learned something at long last. And this is the thing in him that has changed and caused him to start screwing up (from Special Circumstances’ point of view) in missions since he was, himself, literally decapitated.

b8r v2

b8r v2 is going to adopt web-components over components and import over require

Having developed b8r in a period of about two weeks after leaving Facebook (it was essentially a distillation / brain-dump of all the opinions I had formed about writing front-end code while working there), I’ve just spent about two years building a pretty solid social media application using it.

But, times change. I’m done with social media, and the question is, whither b8r?

In the last few weeks of my previous job, one of my colleagues paid me a huge compliment, he said I’d “really hit it out of the park” with b8r. We’d just rebuilt half the user interface of our application, replacing some views completely and significantly redesigning others, in two weeks, with one of the three front-end coders on leave.

I designed b8r to afford writing complex applications quickly, turn hacky code into solid code without major disruption, make maintenance and debugging as easy as possible, and to allow new programmers to quickly grok existing code. As far as I can tell, it seems to do the trick. But it’s not perfect.

Two significant things have emerged in the front-end world in the last few years: import and web-components (custom DOM elements in particular)

import

When I wrote b8r, I found the various implementations of require to be so annoying (and mutually incompatible) I wrote my own, and it represents quite an investment in effort since then (e.g. I ended up writing an entire packaging system because of it).

Switching to import seems like a no-brainer, even if it won’t be painless (for various reasons, import is pretty inimical to CommonJS and not many third-party libraries are import-friendly, and it appears to be impossible for a given javascript file to be compatible with both import and require).

I experimentally converted all of the b8r core over to using import in an afternoon — enough that it could pass all the unit tests, although it couldn’t load the documentation system because any component that uses require or require.lazy won’t work.

Which got me to thinking about…

web-components

I’ve been struggling with improving the b8r’s component architecture. The most important thing I wanted was for components to naturally provide a controller (in effect, for components to be instances of a class), and pave some good paths and wall up some bad ones. But, after several abortive attempts and then thinking about the switch from require to import, I’ve decided to double-down on web-components. The great thing about web-components is that they have all the virtues I want from v2 components and absolutely no dependency on b8r.

I’ve already added a convenience library called web-components.js. You can check it out along with a few sample components. The library makes it relatively easy to implement custom DOM elements, and provides an economical javascript idiom for creating DOM elements that doesn’t involve JSX or other atrocities.

Using this library you can write code like this (this code generates the internals of one of the example components):

fragment(
div({classes: ['selection']}),
div({content: '▾', classes: ['indicator']}),
div({classes: ['menu'], content: slot()}),
)

I think it’s competitive with JSX while not having any of the dependencies (such as requiring a transpile cycle for starters).

<div className={'selection'}></div>
<div className={'indicator'}>▾</div>
<div className={'menu'}>
{...props.children}
</div>

To see just how lean a component implemented using this library can be, you can compare the new switch component to the old CSS-based version.

Aside — An Interesting Advantage of Web Components

One of the interesting properties of web-components is that internally the only part of the DOM they need to care about is whether they have a child <slot>. Web-components don’t need to use the DOM at all except for purposes of managing hierarchical relationships. (Annoyingly, web-components cannot be self-closing tags. You can’t even explicitly self-close them.)

E.g. imagine a web-component that creates a WebGL context and child components that render into container’s scene description.

In several cases while writing b8r examples I really wanted to be able to have abstract components (e.g. the asteroids in the asteroids example or the character model in the threejs example). This is something that can easily be done with web-components but is impossible with b8r’s HTML-centric components. It would be perfectly viable to build a component library that renders itself as WebGL or SVG.

Styling Custom Elements for Fun and Profit

One of the open questions about custom DOM elements is how to allow them to be styled. So far, I’ve seen one article suggesting subclassing, which seems to me like a Bad Idea.

I’m currently leaning towards one or both of (a) making widgets as generic and granular as possible (e.g. implement a custom <select> and a custom <option> and let them be styled from “outside”) and (b) when necessary driving styles via CSS variables (e.g. you might have a widget named foo that has a border, and give it a generic name (–widget-border-color), specific name (–foo-border-color), and a default to fall back to.

So, in essence, b8r v2 will be smaller and simpler — because it’s going to be b8r minus require and components. You won’t need components, because you’ll have web-components. You won’t need require because you’ll have import. I also plan one more significant change in b8r v2 — it will be a proper node package, so you can manage it with npm and yarn and so forth.

<b8r-bindery>

One idea that I’m toying with is to make b8r itself “just a component”. Basically, you’d get a b8r component that you simply stick anywhere in the DOM and you’d get b8r’s core functionality.

In essence the bindery’s value — presumably an object — becomes accessible (via paths) to all descendants, and the component handles all events the usual way.

I’m also toying with the idea of supporting Redux (rather than b8r’s finer-grained two-way bindings). There’s probably not much to do here — just get Redux to populate a bindery and then instead of the tedious passing of objects from parent-to-child-to-grandchild that characterizes React-Redux coding you can simply bind to paths and get on with your life.

Summing Up

After two years, I’m still pretty happy with b8r. Over the next year or so I hope to make it more interoperable (“just another package”), and to migrate it from (its) require and HTML components to import and web-components. Presumably, we’ll have import working in node and (and hence Electron and nwjs) by then.

Happy new year!

Epic Fail

Atul Gawande describes the Epic software system being rolled out in America’s hospitals.

It reads like a  potpourri of everything bad about enterprise IT. Standardize on endpoints instead of interoperability, Big Bang changes instead of incremental improvements, and failure to adhere to the simplest principles of usability.

The sad thing is that the litany of horrors in this article are all solved problems. Unfortunately, it seems that in the process of “professionalizing” usability, the discipline has lost its way.

Reading through the article, you can just tally up the violations of my proposed Usability Heuristics, and there’s very few issues described in the article that would not be eliminated by applying one of them.

The others would fall to simple principles like using battle-tested standards (ISO timestamps anyone?) and picking the right level of database normalization (it should be difficult or impossible to enter different variations of the same problem in “problem lists”, and easier to elaborate on existing problems).

There was a column of thirteen tabs on the left side of my screen, crowded with nearly identical terms: “chart review,” “results review,” “review flowsheet.”

I’m sure the tabs LOOKED nice, though. (Hint: maximize generality, minimize steps, progressive disclosure, viability.)

“Ordering a mammogram used to be one click,” she said. “Now I spend three extra clicks to put in a diagnosis. When I do a Pap smear, I have eleven clicks. It’s ‘Oh, who did it?’ Why not, by default, think that I did it?” She was almost shouting now. “I’m the one putting the order in. Why is it asking me what date, if the patient is in the office today? When do you think this actually happened? It is incredible!”

Sensible defaults can be helpful?! Who knew? (Hint: sensible defaults, minimize steps.)

This is probably my favorite (even though it’s not usability-related):

Last fall, the night before daylight-saving time ended, an all-user e-mail alert went out. The system did not have a way to record information when the hour from 1 a.m. to 1:59 a.m. repeated in the night. This was, for the system, a surprise event.

Face meet palm.

Date-and-time is a fundamental issue with all software and the layers of stupidity that must have signed off on a system that couldn’t cope with Daylight Savings boggles my mind.

A former colleague of mine linked to US Web Design System as if this were some kind of intrinsically Good Thing. Hilariously, the site itself does not appear to have been designed for accessibility or even decent semantic web, and blocks robots.

Even if the site itself were perfect, the bigger problems are that (a) there are plenty of similar open source projects, they could have just blessed one; (b) it’s a cosmetic standard, and (c) there’s pretty much no emphasis on the conceptual side of usability. So, at best it helps make government websites look nice and consistent.

(To be continued…)

Lost Productivity

A couple of months ago I listened to a Planet Money podcast discussing the mysterious slowdown in US productivity growth (the link is to one of several podcasts on this topic). Like most NPR content, the story got recycled through a number of different programs, such as Morning Edition.

The upshot was, that productivity — which is essentially GDP/work — has stalled since the — I dunno — 90s, and it doesn’t make sense given the apparent revolutions in technology — faster computers, better networks, etc.

Anyway, the upshot — and I’m basing this on memory because I can’t find the exact transcript — is that there’s a mysterious hole in productivity growth which, if it were filled, would add up to several trillion dollars worth of lost value added.

Well, I think it’s there to be found, because Free Open Source Software on its own adds up to several trillion dollars worth of stuff that hasn’t been measured by GDP.

Consider the dominant tech platforms of our time — Android and iOS. Both are fundamentally built on Open Source. If it weren’t for Open Source, iOS at minimum would have been significantly altered (let’s assume NeXTStep would have had a fully proprietary, but still fundamentally POSIX base) and Android could not have existed at all. Whatever was in their place would have had to pay trillions in licenses.

On a micro level, having worked through a series of tech booms from 1990 to the present — in the 90s, to do my job my employer or I had to spend about $2000-5000 for software licenses every year just to keep up-to-date with Photoshop, Director, Illustrator, Acrobat, Strata 3d, 3dsmax, Form*Z, and so on and so forth. By the mid aughts it was maybe $1000 per year and the software was So. Much. Better. Today, it’s probably down to less than $500.

And, in this same period, the number of people doing the kind of work I do, is done by far more people.

That’s just software. This phenomenon is also affecting hardware.

The big problem with this “lost productivity” is that the benefits are chiefly being reaped by billionaires.

Father’s Day — Picking Sides in Fallout 4

Random Prattle You Can Skip

As usual, I’m several years behind in my gaming, and — having pretty much completed Skyrim VR (all the major arcs, anyway) I decided to go back and try Fallout 4 (which had frustrated me around the first time I got my ass handed to me repeatedly by synths while doing nothing in particular).

father (head of the Institute)
Father — head of The Institute in Fallout 4 — and my excuse for writing this post today

I played Fallout and Fallout 2 back when they came out on the Mac in the 90s, and loved them. I played the hell out of Fallout 3, but got frustrated by New Vegas and never finished it. In general, I preferred the original games because you got to make significant moral choices (even if sometimes the content was juvenile).

Fallout 3 seemed to have turned into a more conventional action adventure, which I put down to the technical and cost limitations associated with AAA 3D games (building out huge alternate worlds to display widely varying outcomes is expensive, which is likely also why Mass Effect 3 was so lame.)

Anyway, Fallout 4 seems to me to be a return to the greatness of the originals. The moral issues are back and so, apparently are the choices. And, the game looks wonderful. (Both Skyrim VR and Fallout 4 have pretty terrible audio, frequently making me wonder if I have my headphones on backwards, which is impossible with the VR headset; there are a ton of physics, animation, and AI glitches — all of this just has to be accepted and ignored with Bethesda’s games.)

The Moral Question (SPOILERS!)

So, I’m pretty far along, and I’m confused.

In the Commonwealth there are several key factions, which I’ll summarize:

  • The Minutemen — these are the first folks you encounter, a rag-tag militia that’s almost been wiped out and simply tries to restore a cooperative community across the Commonwealth. Whether you like it or not you end up their “General” but (as someone put it eloquently on a forum) you still end up doing all their fetch and carry busywork.
  • The Brotherhood of Steel — this is the most obviously powerful faction. You encounter them, most likely, trying to find Diamond City (they’re very noisy!) Unlike the “lawful good” BoS from Fallout 3, these are more like the quasi-fascist BoS from Fallout 2. They make a good first impression (they’re defending themselves against feral ghouls), but if you steal a journal one of them has left lying around you quickly learn they have a dark side. In any event, when you join (as you pretty much have to) you quickly discover they are human supremacists and also pretty much anti-science.
  • The Railroad — a nod to the Underground Railroad in more ways than one, is a group of idealists trying to free synths from “slavery” and protect them from a surface population that hates and fears them. They’re run like a parody of John Le Carré.
  • The Institute — just as The Empire is introduced in Skyrim by trying to execute you for no particular reason, The Institute is introduced murdering your spouse (husband in my case) and kidnapping your son. Until you finally meet them face to face, all you know about them is that they killed your spouse, kidnapped your baby, they’re responsible for roving gangs of humanoid killer robots (that think out loud to somewhat comical effect), and that everyone blames them for everything, but disappearing people and replacing them in particular. Also, just as Skyrim’s Empire is the only place where you can bring up kids in relative safety and houses aren’t decorated with broken furniture and dead bodies, The Institute is the only place where you can sit down without wanting to sanitize yourself afterwards. (By way of role-play, I jumped on the chance to get a new toothbrush from a library vending machine…)

One of the interesting things I noticed in forum threads about the moral choice posed by needing to pick between these factions is (a) how sophisticated some of the arguments were (although there were plenty of “BoS are the only good guys” and “BoS are fascist losers” comments too), (b) how clever and effective Fallout 4’s writing is. In particular, in making their arguments, many players clearly take as fact that The Institute is guilty of all the things they’re accused of. Even though every missing persons case you investigate turns out to be entirely prosaic, everyone assumes that The Institute really is stealing people to use their organs, or something.

Here’s what you learn by actually visiting The Institute.

  • They create synths as servants.
  • They may have created the super mutants.
  • There doesn’t seem to be any overt cruelty in the way synths are treated, but then again they can mindwipe and reprogram synths at whim which is worse.
  • The gen-3 are almost certainly sentient, look completely human, and are clearly slaves, but The Institute’s citizens are in denial about this. (My favorite traveling companion is a synth detective, apparently a gen-3 prototype, who definitely seems to be sentient.)
  • You can see gen-3 synths being made from scratch out of goo via 3d printing. They’re not assembling stolen organs. (The sequence is very similar to Westworld’s credits, but this is in real-time game engine and came out before Westworld.)
  • It’s The Railroad that uploads people’s memories into synths to help them blend in (because otherwise the people on the surface would just kill them).
  • The Institute’s population includes scientists (“everyone here is a doctor, but I’m the only physician”) but also children (who seem totally normal and carefree).
  • The Institute have built a fabulous arcology underground.
  • Everyone in The Institute seems to be genuinely trying to make their own lives and life on the surface better. Yes, they’re ignorant and arrogant but so are the folks on the surface.

In a nutshell, the argument against The Institute is slavery / mindwipe. The argument for it is that it’s the only place you’d want to live or raise children.

Fallout 4 ultimately lets you choose between these four factions at the end. The Minutemen only really demand you kill The Institute whereas the other factions all want to wipe each other out (but don’t care about The Minutemen).

It seems to me that while The Institute is clearly wrong in its treatment of synths (i.e. slavery) it’s hardly worse than the Brotherhood’s position of exterminating all non-humans (i.e. genocide) especially when you consider that The Institute can actually make the world nice again and The Brotherhood can’t and won’t. It’s not at all clear to me that any of the factions are beyond redemption, but given that — uniquely in Fallout 4 — you’re someone who can remember the prewar world, it seems to me that there’s not much dividing the Brotherhood of Steel or the Minutemen from raiders and scavengers (indeed, there’s a diary in the room of the first synth you’re sent to recover detailing the collapse of a Minuteman splinter group into thugs and murderers), and the only way to return the world to a decent state is to keep The Institute around, and deal with its moral flaws.

Happy father’s day.