The book “NeXTstep Programming Step One: Object-Oriented Applications” by Garfinkel and Mahoney said this about Controllers in 1993:

A good rule of thumb is to place as little code in your controller as necessary. If it is possible to create a second controller that is only used for a particular function, do so – the less complicated you make your application’s objects, the easier they are to debug.

Later, on the same page (p131):

Before you start coding, it’s a good idea to sit down and think about your problem.

Both of these pieces of advice still apply. Neither has been universally internalised 24 years later.

Posted on by Graham | Leave a comment

2017: the year of configuring Linux (or Windows, or OS X, or…) on the desktop

I’m going to FOSDEM next month, maybe I’ll see some of you there. This gives me motivation to solve one of the outstanding problems on my laptop: I currently, as has been mentioned here multiple times, use Windows 10 as a bootloader for my GNU/Linux installation. I would rather boot straight into Linux. So I can set myself a milestone: I would prefer, by the time I get to St. Pancras International train station on Friday 3rd Feb, not to have Windows on this laptop any more.

The laptop is a Alienware 15 R3, although weirdly the processor my laptop contains (Core i7-6820HK) is not one of the CPU options listed on the Dell website, so maybe they changed the configuration without updating the model, or had a spare old CPU knocking around when they built my laptop and decided to use that. Anyway, this is computering, so this is fine. You’re not expected to know or care that you don’t have the correct bits in the computer, just that it’s “Late 2016” (even though they still sold the R2 in late 2016, too).

The problems I have seem to fit into one of two categories: either the wi-fi (a Qualcomm Atheros chipset) doesn’t work, or the CPU/motherboard chipset (see above) isn’t supported and all hell breaks loose.

The wireless situation is that the wireless should be fully supported: Qualcomm Atheros integrated the driver into the Linux kernel back in version 3.11-rc1, in July 2013, and supply the firmware binaries. And so it doesn’t work in modern Linux kernels (or doesn’t reliably work, or fails for different reasons).

The chipset situation is that Intel integrated the driver into the Linux kernel back in version 4.3, in November 2015. So it doesn’t reliably work in modern Linux kernels.

I could go into the specific problems I’ve seen and the specific things I’ve tried to work around them, but I won’t. I won’t because well-meaning but unengaged people will ask me infuriatingly basic and irrelevant questions (yes, I have already turned Secure Boot off; no, it doesn’t change the fact that the ath10k module hasn’t loaded), or suggest unjustifiable solutions. The most common is the Distro Pimp: you should try [Debian/Debian testing/Arch/Ubuntu/openSuSE/Fedora/Mint/wait, which one did you say you’d already tried?]. Well that’s nice, but the distribution I tried (that didn’t work) is made of GNU and Linux 4.8, and the distribution you’re suggesting is made of GNU and Linux 4.8, so what specifically is it about your distribution that makes you think it works where this other one doesn’t? Oh, they focus on [stability/cutting edge/purple desktops/compiz effects/bible-reading software] do they? And how does that solve my problem where the kernel doesn’t work, despite being newer than all of the bits I need to have a working kernel?

This is the reality of Linux on the Desktop, the one that computerists say the world is ready for. Of course, it’s also the reality of everything else on the desktop. Something that occasionally happens in my Windows 10 bootloader is that it reboots while I’m using it to install some updates, because I stopped moving the mouse for a couple of minutes between 6pm and 9am (you know, the time when I’m at home, using my home computer). Some colleagues at work use Windows as an actual operating environment, and have things like Skype (made by Microsoft) popping up a notification when they’re presenting in PowerPoint (made by Microsoft). Something that apparently happens to people that have Macs is that the built-in PDF software doesn’t work well and they have to buy somebody else’s PDF software, except that they have to check whether that other PDF software is based on the built-in stuff or is something written by somebody else only they can’t because without the Four Freedoms they don’t have the freedom to study how the program works, and even if they could fix the problem they’re not allowed because they lack the freedom to redistribute and make copies to help their neighbours, or to improve the program so the whole community benefits.

This is fine.

Posted in Scam | Leave a comment

The problem with not-Apple

I’ve read a few articles over the last week or so that point to the Mac having lost its shine among developers. There was a time when the first things you did when you wanted to be a developer on the Free Software platform Ruby on Rails were that you bought an Apple PowerBook and the proprietary TextMate editor. There was a time when even Sun’s employees programmed Java on Macs. But now, I read things like this:

Right now, the only real option Apple has offered [vocal developer supporters] is the iMacs, which seems to be their answer for high end machines. That may work for some, even thought it won’t be their first preference for many. It’s clearly left many disgruntled and some thinking of jumping ship to other manufacturers, either running Linux or Windows. Source: Apple’s 2016 in review

Apple’s review process for [Safari browser] extensions is disorganized, arduous and quite frankly insulting Source: What Apple gives you for $100 as a Safari Extension Developer

the current state of the Mac has me considering whether it’s still the right platform for me. Source: Finding an Alternative to Mac OS X

It seems like Apple has either lost its way, that it has lost touch with what (some of) its customers want, or that it simply doesn’t care about those customers. Developers are a captive audience, and creative professionals can switch to Windows, I guess. Apple no longer considers them core. Source: New MacBook Pros and the State of the Mac

For me the sheen was long-gone back in November 2014, and in January 2015 I posted about switching (back) to Linux. That was around the last time the blogosphere was telling us all that Apple had lost their way – funny how these badly-run companies manage to sell more of their shit than their competitors for years on end, non? Anyway, it was the popularity of the meme that led me to post, but my story about falling out of love with their treatment of Free Software and the make-work associated with being in their developer programs which you can read about in that post is personal to me.

There’s a problem, though, and that problem is consistency. NeXTSTEP, more or less, can be summarised as “let’s make an Alto, but compromise on using technology that already exists”. So you get your Alto technology like OOP and ethernet and laser printers, but you also get the compromises – Display PostScript, UNIX, GNU, and C. There’s one system to learn (Objective-C and the various object “kits”), and then a few subsystems (UNIX and GNU, Mach, NetInfo, DPS) that make themselves known if you dig in.

Mac OS X is less of a NeXTSTEP than NeXTSTEP, but the romance of consistency still exists. I can tell myself, partly because it’s true but also because I invested over a decade of my life in working around the flaws in the model, that OS X is still Objective-C and kits with a wider selection of kits (Core Data, GameKit, PDFKit etc) and a few more compromises.

You definitely can’t say that of Linux, particularly as a developer. The application my group works on now is written in Qt, which is itself a nice framework (Qt with its meta-object compiler is to C++ as Objective-C is to C, in a way that GTK+ is not), that for the most part just sits on top of Linux (and other platforms) as a Qt application. The problem is, when you want to do something that isn’t in Qt’s equivalent of the app kit, you may not only have to choose one of a few different alternative technologies but actually choose all of them if your users might not all have chosen the same one.

Even on my own laptop that’s true. It is…well, for reasons that I just haven’t put the effort into solving, it’s actually running Ubuntu 16.10 in VirtualBox in Windows 10 (whomp!), but what I see is that it’s running Ubuntu 16.04. Now I could, and do, use GNUstep as an application development environment, and get my Objective-C and kits running on something like Unix just as I’m used to. But that inconsistency is always there, always at the forefront, always chipping away. Because the window manager does not use the Objective-C runtime, and uses weird X things to communicate with processes rather than Objective-C messages. The browser is Firefox, because while there is a GNUstep browser, it’s not very good (mostly because its WebKit is not up to date, but then WebKit is itself not Objective-C either). My Linux uses systemd to start processes, your Linux uses rc files/init files/upstart. My GNUstep is drawing with Cairo, yours is drawing with X intrinsics.

There’s a problem with that problem, though, and it’s that the consistency of Mac OS X is a fiction.

Are Dashboard widgets made out of JavaScript because of a compromise, or an aborted change of direction? Is the lack of consistency between the same API’s names for things in Swift and in Objective-C a cognitive overload that’s worth carrying around? Do I ignore the funky dialect of C++ that drivers are written in (I have written IOKit drivers and edited a book on the technology, so this isn’t a hypothetical concern)? While some ObjC APIs use message-sending and others use block callbacks, am I right to call them both the same thing? Does this process communicate with that process using XPC, Mach IPC, UNIX pipes, sockets, signals, or distributed notifications?

The romance turns out to be based on a lie, but on a powerful and compelling lie that’s easy to believe, and easy to miss even if you’re unsure whether it ever existed.

Posted in GNU, gnustep, Mac | Leave a comment

Resolution: Share Subscriptions

In Resolution: Subscribe Self I said I’d share my list of feeds. The nice thing to do would be to document a blog roll detailing why I subscribe to each blog, but for the moment here’s an OPML file you can import into your reader, and consider the feeds you find therein.

Posted in whatevs | Leave a comment

Resolution: Subscribe Self

I have, at least temporarily, stopped using the social media to find news. I publish an RSS feed here, and your other favourite sites probably do too, so we can all discover the things we want to read without having to wade through a morass of things we don’t.

Soon, I’ll collect some recommended feeds together. What are yours? Which are the high-quality, low-volume feeds you make sure to catch every post on?

Posted in whatevs | 1 Comment

This is fine

The BBC micro:bit is a tool for introducing young people to programming. It’s a little embedded computer with a few inputs and a matrix of LEDs for output, as well as some control lines. In principle it’s quite easy to use, I made a 1d6 simulator:

from microbit import *
from random import randint

class Die:
    ONE = Image("00000:"
                "00000:"
                "00900:"
                "00000:"
                "00000")
    TWO = Image("00000:"
                "09000:"
                "00000:"
                "00090:"
                "00000")
    THREE = Image("00000:"
                  "09000:"
                  "00900:"
                  "00090:"
                  "00000")
    FOUR = Image("00000:"
                 "09090:"
                 "00000:"
                 "09090:"
                 "00000")
    FIVE = Image("00000:"
                 "09090:"
                 "00900:"
                 "09090:"
                 "00000")
    SIX = Image("00000:"
                "09090:"
                "09090:"
                "09090:"
                "00000")
    ALL = [ONE, TWO, THREE, FOUR, FIVE, SIX]
    @classmethod
    def throw(self):
        return self.ALL[randint(0,5)]


display.show(Die.ALL, delay=100, wait=False, loop=True)

while True:
    if button_a.is_pressed():
        display.show(Die.throw())
    elif button_b.is_pressed():
        display.show(Die.ALL, delay=100, wait=False, loop=True)

Simple (I mean, simple if you know what the word randint means (hint: it means “random integer” as long as you know what an integer is), that programming languages that aren’t Fortran call the first element of an array element zero, even though it’s obviously ONE as far as a die is concerned, and you’re OK with the word classmethod).

Here it is in action: woo! I AER PROGRAMMER!!!

And here’s the litany of things I did to get there:

  • I opened the “details.txt” file on the micro:bit, which tells me a load of build numbers and flash dates. I don’t know what I’m supposed to do with that. This is hard.
  • I opened the “microbit.html” file on the micro:bit, which redirects me to microbit.co.uk, which tells me that as part of the BBC’s restructuring of its online content, I will be redirected to microbit.org. I decided this was probably OK, and ended up looking at the same site but with a different URL (whatever one of those is).
  • I clicked on the introductory video and was told that I need an Adobe Flash Player, whatever one of those is.
  • I eventually found enough buttons to find a website that is a python editor that lets me write code for my micro:bit, and a tutorial for writing Python for the micro:bit. I know what a python is, but do not know why I would want a snake for my micro:bit.
  • The tutorial tells me to use a thing called a “mu”, which is apparently not the website python editor but is another python editor. I do not know what a mu is, but I must download it.
  • There are three different download buttons, depending on whether I have a Windows, a Mac, or a Linux, whatever they are.
  • If I have a Windows, then I to enable the REPL (whatever that is) I must download a serial driver (whatever that is).
  • The driver site tells me that if I have a Windows 10 (whatever that is), then I should not download the serial driver.
  • If I have a Mac, then the first time (but maybe not other times, that’s not clear) I open the mu I have to right click it.
  • If I have a Linux, then I must chmod u+x the mu and make sure my user (isn’t that me?) is in the dialout (whatever that is) group (whatever that is).
  • Now I can write my python. To put it on the micro:bit, I must “flash” it. I guess that is because I have an Adobe Flash Player from earlier.
  • The micro:bit shows me helpful messages when I get something wrong. It scrolls the message “id=41 SyntaxError: invalid syntax” when I flash my python. I do not know what this means, but I was told that it’s helpful. Therefore I am stupid.

I am not singling out the BBC, the micro:bit makers, the mu creators, Microsoft, or any of the other individuals or organisations involved with creating this easy-to-use educational environment. This is fine. This is how computers work, nay this is how computers work when we are making it easy to work them. This is our industry.

To quote Freddie Mercury: is this the world we created? We made it on our own. Is this the world we devastated, right to the bone? If there’s a God in the sky looking down what can he think of what we’ve done to the world that we created?

Posted in edjercashun, Responsibility | Leave a comment

By the river

My home stands near to a bridge over the Avon, the same river that lends its name to Stratford-on-Avon. By walking to the end of my street then through the churchyard, I could stand over the river and watch it flow beneath me. But I didn’t. I elected to walk a few kilometres upstream to the grounds of the big house, and stand on that bridge instead. Walking is something I do, apparently. My phone tells me that I walk more than the average man, an achievement I can claim as my own.

It was raining, so I took an umbrella. In theory, I was listening to the patter of the rain on the umbrella, and watching the water flow through the reeds as it washed underneath me, then past my house and the church, past Shakespeare’s birthplace and onto Tewkesbury and the Severn. In fact I did nothing of the sort. The river and its reeds must have been there, and I was pointing in their direction. I was vaguely aware at one point in my half-hour stop of a car on the driveway, approaching me, stopping just short of where I was, then carrying on over the bridge and on to the road. I did not acknowledge the driver, and if that person acknowledged me I failed to notice it.

Of things that I saw, the one that sticks in my mind is the notification light on my phone. It is my beacon to the outside world, letting me know when somebody wants my attention. Twice I remember looking at it, and twice I remember seeing the blue blink that signifies contact via email. Twice I read this link to society at large, to discover that somebody wanted to sell me the world’s most powerful flashlight and that somebody else thought I would be interested in a walk-in bathtub. Isn’t technology a marvel?

Of things that I heard, probably the car had some sort of engine and tyres that rumbled as it made its way past, and presumably the dual carriageway a few hundred metres away was contributing some white noise. The only sound that I remember hearing is my internal monologue. It’s a toxic sound, reminding me as it does that I have no reason to be pleased about anything, but it is my constant companion. I struggle to hold back tears as it reminds me that my home life, my social life, and my work life, are all in flux at the moment, all out of my control, and the common thread running through them all is the person who lost that control. It goes on to tell me that anything else I might try is doomed to failure, too.

I consider using that phone again, not to look at the notification light, but to tell somebody how I’m feeling. Why would you want to do that, asks the voice? These people have their own things to deal with, why burden them with your problems too? Why spoil somebody’s evening by telling them that you’re upset, when they’ve done nothing to upset you? Why are you so selfish? You’re a grown-up, a man who walks more than the average, you’re supposed to look after yourself now. You’re not supposed to be a mess with a state-sponsored Citalopram habit.

I turn the phone around, thinking of taking a picture of the trees silhouetting the clouds, stained Sodium-orange by the streetlights of the nearest town. The screen remains resolutely black. Of course it did, you idiot, it’s much too dark to take a photo with that phone. You’re supposed to be some kind of expert at smartphones, don’t you know how their cameras work? I vaguely consider whether to fetch my SLR camera, but of course that’s been in a box for over a year and it’s doubtful the battery is even charged. Maybe it’s time to sell it on eBay, but of course you won’t get a good price for it and then it’ll get damaged in the post and the buyer will want a refund and you won’t even have kept that money. Why bother?

It took effort to walk the twenty minutes upstream to the other bridge. My voice told me that I would be just as useful to the world if I didn’t take the walk, if I had stayed in bed and waited until it was time to go to work tomorrow. Well, voice, I took everything you told me and made a few hundred words of blog post out of it, so I have done something after all. The joke’s on you.

Posted in whatevs | 2 Comments

Answer: none of them

A question programmers frequently ask when they’re considering career growth or personal learning is “which programming language should I learn next?”

Why would learning another programming language help? If you only know one programming language and it is provided by a single vendor, then learning another will decouple your success from theirs, but that might not be such a common situation. Well, a book like Seven Languages in Seven Weeks makes the point that it’s not about learning the language, but about learning the model and thought process enabled by using that language. OK, so why don’t I learn that model or thought process, using the tools that are already available to me, instead of having to add fighting unfamiliar syntax to the problem?

And if what I’m truly trying to do is to learn to think about problems in a different way, a week-long effort at dabbling in a side project isn’t going to change my way of thinking. Those years of learned processes, visualisations and analyses are going to take more than a couple of hours to dislodge. I’ve worked through Seven Languages, and the fact that I spent a couple of hours solving the Eight Queens Problem in Prolog (or in fact telling Prolog what a solution to Eight Queens looks like and letting it solve it) doesn’t mean I now think about any other software problem as if I’m using a logic programming tool, or even as if I have such a tool available. I’ve spent much longer than that studying and using the relational calculus and SQL, but don’t even think about every problem as if it should be a collection of tables in the third normal form.

It may be that it would be useful to learn something that isn’t a programming language, shock horror! It turns out that programming is an activity embedded in a socio-technical system comprising other activities, and you might need to know something about them: software security, testing (I think I can count on my noses the number of programmers I’ve met who haven’t responded to the phrase “equivalence partitioning” with a blank stare, and I wouldn’t use all of my noses), planning, business, marketing, ethics…I even wrote a whole book on the things programmers should know that aren’t programming.

And then there’s the thing that your customers, clients, colleagues, or victims are trying to do with the software. Learning something about that would make it easier to empathise with them, to evaluate your solutions in context, and to propose better ways of working and better ways for your software to enable their work. Rewriting your code in Elixir would…not do that so much.

Posted in advancement of the self | 1 Comment

I fix things for a living

Previously, on SICPers, I wrote that I make mistakes for a living. But making mistakes is no good if nobody’s cleaning up after them, so I also fix things. Whatever gets in my team’s way, it’s my responsibility as their lead to make sure that it’s no longer in their way.

Whether it’s a process we instituted that slows us down, some technical debt that gets in the way of new development, or some infrastructure not behaving itself, it needs to go, and I either need to clear it out or find somebody to do it for us. On my team I’ve been nicknamed “Mister Fix-It” as a result of my policy of getting rid of everybody else’s impediments before doing my own work, and we even have a Fix-It support queue just like our customer support queue. Except it’s not our customers I’m supporting, it’s my colleagues. Tickets in my queue range from “this script doesn’t handle this case and did the wrong thing when I tried to do a build” to “merge these three repos into a monorepo”. It doesn’t matter, it’s in our way, so it needs shifting.

Or does it? Is it, in fact, in the way, or are we solving the wrong problem? Some of the tickets in the Fix-It queue magically transmogrified from “Fix This” to “Measure This”: let’s discover where the problem really is before we solve something else.

Posted in Responsibility | Leave a comment

No, you can’t ignore politics

I wrote, a couple of years ago, about the fact that you can’t ignore ethics in software engineering. Your software is built for a reason, it’s used for a reason, you need to be aware of those reasons and whether you’re supporting or enabling them.

That goes for politics too. That hacker news declared this week to be politics-free week shows an immaturity and unprofessionalism that makes it a dangerous place to learn about making software from. Making software is the act of some people producing things for other people, it is inherently a political act. Choosing a framework or programming language is political. Attending a meet-up is political. Being paid is oh-so-political. Publishing your side project under an OSI-approved licence? The OSI is a political organisation, the courts that will determine whether the terms of your licence are binding are political, the officials of those courts are selected by a political process.

And, anyway, let’s have a look at the front page of hacker news now, roughly five days into their politics-free week.

What they probably mean is not “political stories are off-topic”, but that political stories that stray from the default politics are off-topic. Anything that doesn’t sound like I agree with it must be subjective, whereas things I agree with are objective. Just as the default narrative in society is often white, male and affluent, so it is those things in the Valley and neolibertarian. Anything else is just politics.

Posted in economics, Responsibility | Leave a comment