In The Abstract

18 Aug 2016

In Under the Radar #37, David and Marco discuss code reuse, and the benefits of abstraction. They come down solidly on the side of YAGNI — You Ain’t Gonna Need It. In other words, it’s usually not worth putting extra effort into making something more general than it needs to be right now, as you’re unlikely to correctly predict the way in which it will need to generalise (if it ever does).

This is certainly not a straw man; it’s a trap I’ve often seen people fall into, myself included. However, I’ve also seen people go too far in the opposite direction, viewing any abstraction or generalisation as a problem.

This made me look at my own use of abstraction, and I found myself thinking of the Field Notes brand tagline:

“I’m not writing it down to remember it later, I’m writing it down to remember it now.”

Similarly, I tend not to create abstractions to cope with future cases, but in order to understand the code that’s already there. Some people understand things best when they’re concrete and explicit, but I’m not one of them. I need to systematise things, to put them in a framework and create rules. This is one of the reasons I’m attracted to programming. The framework I construct to understand isn’t just a model of something; it can be the thing.

Abstraction, of course, can have numerous other benefits — brevity, clarity, and yes, even reuse. For me, though, it’s first and foremost a tool for understanding what the hell’s going on.

HyperDev, HyperCard and a Small Matter of Programming

12 Jun 2016

HyperDev, a new web development product from Fog Creek, looks very promising. It aims to remove the friction from creating a web application by getting rid of all the incidental complexity usually associated with development. To quote from Joel’s introductory post:

Step one. You go to

Boom. Your new website is already running. You have your own private virtual machine (well, really it’s a container but you don’t have to care about that or know what that means) running on the internet at its own, custom URL which you can already give people and they can already go to it and see the simple code we started you out with.

All that happened just because you went to

Notice what you DIDN’T do.

  • You didn’t make an account.
  • You didn’t use Git. Or any version control, really.
  • You didn’t deal with name servers.
  • You didn’t sign up with a hosting provider.
  • You didn’t provision a server.
  • You didn’t install an operating system or a LAMP stack or Node or operating systems or anything.
  • You didn’t configure the server.
  • You didn’t figure out how to integrate and deploy your code.

This is a big deal. If you’ve been programming for a while, you cease to notice the rituals and rain dances required to get things working. You build up mental callouses, and after a while forget that the accidental complexity is even there. To someone just getting started, this is a major impediment1. HyperDev shows that it’s an unnecessary one.

Crucially, HyperDev isn’t a toy environment, a sandbox for learning the basics. It produces real applications, running on a real platform2. You can take what you’ve created, deploy it elsewhere, and expand it on any way you choose. This turns it from a dead end into a launch pad.

All this makes it interesting as a platform for end user development — allowing users who aren’t developers, and don’t necessarily want to be, to use web technology to solve their own problems. However, while they’ve removed most of the rough edges, one thing remains that makes it less than perfect for this use case: programming itself.

Consider two end-user development systems (perhaps the only two) that have seen widespread success: HyperCard3 and Excel4. Both are notable in that you can start using them interactively and directly, and immediately get value from them without programming at all. Excel is a useful tool even if you just type figures into a grid and make charts. Not everyone needs to bother with formulae, and even fewer with Visual Basic, but those facilities are there as and when you need them. Similarly, HyperCard allows you to start with a simple graphical editor, and move on to links and then scripts.

In the case of Excel, the overall architecture is geared towards the simple case, and it shows the strain when pushed into more complex use. HyperCard was had a better model in this regard, but the vagaries of the market meant it never got a chance to keep pace with changes in the technology landscape. HyperDev’s story for progression is stronger than either, at the expense of missing out the first step.

In summary, HyperDev does a fantastic job of removing unnecessary friction from traditional development. It’s shaping up to be a useful tool in its own right, and it also acts as an existence proof to make us reexamine the assumptions embedded in our existing environments. In terms of empowering end users to solve their own problems, though, there’s still more to explore.

The title of this post is a reference to A Small Matter of Programming, by Bonnie Nardi, a great book covering the motivation and theory behind end-user programming.

  1. Some regard this as a badge of honour, a shibboleth, a bouncer on the door keeping out the riffraff, and see it as a good thing. It isn’t. [back]

  2. Well, Node.JS. [back]

  3. I assume that the name “HyperDev” is a nod in this direction. [back]

  4. Fog Creek founder Joel Spolsky worked on Excel when at Microsoft; I’d be interested to hear how his experiences there shaped the development of HyperDev. [back]

Web Fonts

9 Dec 2015

One of the things I enjoy doing with this site is tweaking the design. I’ve previously written about the goals I’m aiming towards when I do this. Along with the publication of this post, I’m made another change in order to get closer to the ideal described there; I’ve introduced web fonts.

In that previous post, I was less than complimentary about web fonts:

No web fonts for body text. This not only adds another resource to the page load, but unlike an image or style sheet it renders the text itself invisible until it arrives. Until someone works out a way around this, I’m steering clear of web fonts for sites with casual visitors.

This is all still factually correct, but I’ve reconsidered how it relates to my goal of a fast, lightweight site that works well for drive-by readers. Firstly, I realized that the that the biggest non-content resource on all pages was the logo, which is just text. If I could replace this with real text in a font of my choice, I could eliminate the image entirely while still retaining visual control.

The second aspect, the invisible text while loading, remains, but isn’t the problem I thought it was. Even in my original objection I left myself an out — the body text is still in reliable old Georgia, and so will not be affected. A brief delay in the rendering of headings and so on seems acceptable, as long as it really is brief. On a lot of sites that use web fonts, it isn’t — it’s often noticeable, and occasionally a real impediment to getting to the content. Why do I think I can do better?

The main problem isn’t web fonts themselves (which are a just a resource like any other), but rather the way they’re often implemented. Services like Adobe TypeKit and Google Fonts offer a wide range of high-quality fonts, hosted on their own servers. This makes for painless integration — just add a single stylesheet and you’re done — and allows them to manage licensing and pricing, but comes at a cost. Third party resources like this not only put you at the mercy of someone else’s operations and priorities, but can also torpedo performance by requiring a separate HTTP connection and DNS lookup. For reasons of both performance and pigheadedness, I ruled such services out.

The alternative is to host the font yourself, just like a stylesheet or image. There’s no technical trick to this, but it requires a font licensed in such a way that allows redistribution. Unless you’re willing to pay far more than I can justify, this rules out most well known fonts from major foundries (who, not unreasonably, want to charge for their work). However, in parallel to the software world, there are fonts with more open licenses which would suit my purposes. After a bit of searching on FontSquirrel, I came across the rather nice Cooper Hewitt, a font that the Cooper Hewitt Smithsonian Design Museum commissioned for their own branding and then released under an open license. The light weight fit with the look I was aiming for, and the integration was straightforward. I also took the opportunity to replace some image links with text, meaning that there are now no non-content images on the site.

So, what’s the end result? Looking at the previous post, which is short but not unusually so:

  • Before: six resources, totaling 65.3KB.
  • After: four resources, totaling 34.0KB, a little over half the size.

So, not only do web fonts make the site prettier and more accessible, they substantially reduce both the size and number of resources. This translates into genuine performance gains for anyone visiting the site. When I started looking at web fonts, my aim was to improve the appearance without increasing load times, so such a marked improvement is a very nice bonus.


Having inlined the font stylesheet into the main one, the page is now down to three resources — the HTML, a single stylesheet, and the font itself. The total size remains about the same.

Hashes In Space

18 Sep 2015

IPFS - InterPlanetary File System - is an open source project to create a “permanent web”, one that avoids the broken links and single points of failure arising from HTTP. Kyle at NeoCities explains this in far more detail, but the core idea is to replace URLs with hashes, resulting in content-addressed links.

We use such hashes extensively at Cydar to wrangle the data flowing through our distributed system, so I know first hand that they’re a straightforward and effective way to tackle this. Content hashes solve the two hard problems in computer science: names are unambiguous and can be generated locally, and the corresponding content is effectively immutable, meaning cache invalidation isn’t required. Throw in the fact that integrity checking is built in, and you have a compelling approach to handling distributed data.

IPFS is by no means perfect. In particular, while I like the content addressable part, I’m less convinced about the blockchain-based naming mechanism. Nevertheless, there’s definitely enough there to make it worth keeping an eye on.


29 Aug 2015

The history of computing is full of toys that nobody would seriously try to get real work done with. The PDP was a toy. The Apple II was a toy, and so was the Mac. Unix was a toy Multics, C a toy version of Algol (thrice removed), and the Web a toy in comparison to Xanadu.

With renewed rumours of an iPad Pro, people1 are again suggesting that the iPad (and tablets in general) isn’t suitable for real work. If history is anything to go by, this is a pretty good indicator that it’s an avenue worth pursuing.

  1. Such as Marco on ATP episode 132. [back]

This site is maintained by me, Rob Hague. The opinions here are my own, and not those of my employer or anyone else. You can mail me at, and I'm robhague on Twitter. The site has a full-text RSS feed if you're so inclined.

Body text is set in Georgia or the nearest equivalent. Headings and other non-body text is set in Cooper Hewitt Light. The latter is © 2014 Cooper Hewitt Smithsonian Design Museum, and used under the SIL Open Font License.

All content © Rob Hague 2002-2015, except where otherwise noted.