Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Tuesday, February 9, 2010

On multitasking

TidBITS unwittingly hits the nail on the head while talking about iPad OS multitasking (emphasis added):

It’s easy to imagine wanting to use an iPad to read text in Mobile Safari, copy some text to a Pages document, and send that document to a colleague via Mail. That specific example may turn out to be possible with the current iPhone OS, but it points toward needing more ways for iPad apps to work together in the future.

Let me break down the user’s workflow here:

  1. User reads text in Mobile Safari.
  2. User copies text to a Pages document.
  3. User e-mails that document to a colleague.

The flow of tasks is linear. The user does not need Mail open while reading the text in Safari, nor Safari open while pasting text in Pages. Whether a platform supports multiple simultaneous applications or not, users typically work with one at a time.

The advantage of multiple open apps is that the user can switch tasks really quickly (the other oft-quoted benefit, of being able to see context in multiple places at the same time, is actually a feature of a windowing UI: a different technology, and one that iPhone OS lacks). The disadvantage is a technical one—the operating system must allocate resources to applications that the user isn’t currently working with. The iPhone (and, I presume, the iPad) provides fast task-switching anyway, through its recommendation that app developers retain app state on termination and recover it on launch. The act of moving between apps via the home screen is supposed to feel like switching tasks, even if it’s implemented by a kind of pause-and-resume.

posted by Graham Lee at 11:36  

Saturday, January 3, 2009

Quote of the year (so far)

From David Thornley via StackOverflow:

“Best practices” is the most impressive way to spell “mediocrity” I’ve ever seen.

I couldn’t agree more. Oh, wait, I could. thud There it goes.

posted by Graham Lee at 01:15  

Saturday, January 3, 2009

Tautology of the year (so far)

From iDefense, via DarkReading:

A recent wave of fatwas issued by radical Islamic religious leaders in that region authorizing these groups to use cyberattacks to defend Islam has opened the door for these groups to wage cyberattacks, according to iDefense.

In other news, water has been found to be wet. (seriously considering a “my beloved language, you’ve killed it!” tag)

posted by Graham Lee at 00:16  

Tuesday, December 2, 2008

You keep using that word. I do not think it means what you think it means.

In doing a little audience research for my spot at MacDev 2009, I’ve discovered that the word “security” to many developers has a particular meaning. It seems to be consistent with “hacker-proof”, and as it could take most of my hour to set the record straight in a presentation context, here instead is my diatribe in written form. Also in condensed form; another benefit of the blog is that I tend to want to wrap things up quickly as the hour approaches midnight.

Security has a much wider scope than keeping bad people out. A system (any system, assume I’m talking software but I could equally be discussing a business process or a building or something) also needs to ensure that the “good” people can use it, and it might need to respond predictably, or to demonstrate or prove that the data are unchanged aside from the known actions of the users. These are all aspects of security that don’t fit the usual forbiddance definition.

You may have noticed that these aspects can come into conflict, too. Imagine that with a new version of OS X, your iMac no longer merely takes a username and password to log a user in, but instead requires that an Apple-approved security guard – who, BTW, you’re paying for – verifies your identity in an hour-long process before permitting you use of the computer. In the first, “hacker-proof” sense of security, this is a better system, right? We’ve now set a much higher bar for the bad guys to leap before they can use the computer, so it’s More Secure™. Although, actually, it’s likely that for most users this behaviour would just get on one’s wick really quickly as they discover that checking Twitter becomes a slow, boring and expensive process. So in fact by over-investing in one aspect of security (the access control, also sometimes known as identification and authorisation) my solution reduces the availability of the computer, and therefore the security is actually counter-productive. Whether it’s worse than nothing at all is debatable, but it’s certainly a suboptimal solution.

And I haven’t even begun to consider the extra vulnerabilities that are inherent in this new, ludicrous access control mechanism. It certainly looks to be more rigorous on the face of things, but exactly how does that guard identify the users? Can I impersonate the guard? Can I bribe her? If she’s asleep or I attack her, can I use the system anyway? Come to that, if she’s asleep then can the user gain access? Can I subvert the approval process at Apple to get my own agent employed as one of the guards? What looked to be a fairly simple case of a straw-man overzealous security solution actually turns out to be a nightmare of potential vulnerabilities and reduced effectiveness.

Now I’ve clearly shown that having a heavyweight identification and authorisation process with a manned guard post is useless overkill as far as security goes. This would seem like a convincing argument for removing the passport control booths at airports and replacing them with a simple and cheap username-and-password entry system, wouldn’t it? Wouldn’t it?

What I hope that short discussion shows is that there is no such thing as a “most secure” applications; there are applications which are “secure enough” for the context in which they are used, and there are those which are not. But the same solution presented in different environments or for different uses will push the various trade-offs in desirable or undesirable directions, so that a system or process which is considered “secure” in one context could be entirely ineffective or unusable in another.

posted by Graham Lee at 00:45  

Wednesday, October 15, 2008

It was asked for: the “features” post

Someone anonymous once said:
I’m intrigued by your feature comment. Please publish said blog post!
Where said comment was:
The fact that I have stopped using the word ‘feature’ in many contexts is an entire blog post and a few therapy sessions in itself.
So here, for your delectation, is that entire blog post.

When you’re trying to decide what software people want, and indeed how to tell them that they want whatever software they’re going to get instead, that’s marketing (mainly – it’s partly sales, and there’s yet another tangential post on why I occasionally deliberately conflate marketing and sales). Marketing works in terms of features, which for the purposes of marketing means “properties or qualities of the software which we think might make people interested in that software”.

When you’re trying to decide what software to build, or trying to build the software, more specific terms are used. Initially people split requirements into two distinct groups, functional (what the system is capable of) and non-functional (how the system goes about its capabilities), but a more precise organisation is often needed. For instance, a requirement of system security might result in both functional and non-functional aspects of the system being specified.

Of course, some or all of the capabilities are also features, in fact it’s generally true that the set of all features, the set of all known requirements and the set of things the customer wants are intersecting subsets of the set of all possible qualities of a software system. Companies without an intersection between any two of these sets tend to go out of business very quickly. But the sets rarely perfectly overlap.

For instance, it’s a feature of Windows 7 that it’s named differently from Windows Vista, because Microsoft’s marketing requires that customers believe that they’ve put Vista behind them. However, it’s also a feature of Windows 7 that it not be very distinct from Vista, because marketing require that application compatibility doesn’t get broken. Hence we have the interesting situation that Windows 7 is also Windows 6.1. And if Microsoft think they’re being innovative in that version numbering policy, they should try looking up the history of SunOS/Solaris version numbers. BTW, indeed I haven’t switched my SUNW tag to JAVA, because I already use the java tag to mean the Java language and the Java platform. Marketing people can be funny sometimes.

Another example, less confusing though more contradictory, is Apple’s Snow Leopard collateral. The fact that marketing are telling us there are no new features in Snow Leopard means that “no features” is something they believe we might want to buy, which in turn makes it a feature… confused?

So anyway, I try to avoid using the word “feature” when I’m talking about software, because I’m usually instead talking about a capability or property of a software system, and not about marketing that software system. For instance, in Properties about a year on I described properties as a capability of the Objective-C 2.0 language, which indeed they are. It happens that properties is also a feature of the language (don’t believe that programming languages have marketing departments? What else do Apple’s tech evangelists do, if it isn’t marketing?), but in the case of that post I was talking about what can be done with properties, how properties can be used, and not how they can switch developers to Leopard from Tiger or .NET.

And in other news, it seems that badly-parked tech company founder Mercs are back in fashion.

posted by Graham Lee at 20:27  

Thursday, September 25, 2008

Rhetoric, smoothly outlined

Something I did a number of years ago (I could tell you how many, couldn’t I? If I could remember; I think it must have been 7) was to study critical analysis. That’s the application of linguistics and sociology to, well, basically to refusing to believe anything people say to you ever again. As an example of how it’s useful to someone who isn’t a professional rhetorician, here’s a discussion of the things I read in The iPhone Store Impending Disaster Myth. Mainly because that article is fairly close to the top of my RSS feed reader.

The first thing to note is the use of loaded language in the title – the hyperbolic phrase “impending disaster” and its syzygy with the word “myth” clearly setting the author’s stall out. This is reinforced by the first paragraph:

According to the predictable opinion scribes […]They’re wrong, here’s why.

That first sentence fragment paints the subjects of the author’s post as thoughtless machines, churning out page after page of text reinforcing their unchanging opinion. Ironically that is exactly what we are about to read for the next several paragraphs. It’s a convenient amalgamation of two rhetorical techniques; most obviously it is an ad hominem (to the man) argument. Attention is diverted away from the discussion of Apple’s app store and onto the people with which the author disagrees. This then is the beginning of a straw man which will be constructed toward the end of the piece, sowing the seed in the reader’s mind that the author’s opponent does not have a relevant argument.

The final sentence, “they’re wrong, here’s why”, is a trademark of this particular author (or maybe that’s an example of confirmation bias on my part) and actually renders the rest of the article meaningless for most people. It tells us that the rest of the article is a repudiation (for why it isn’t a refutation, read on, but the point of this sentence is some verbal sleight of hand to make you believe that a refutation is to follow) of the position the author has defined for the “predictable opinion scribes”, which is either going to make you believe that what’s coming up will be an excellent riposte or a boring diatribe, depending on the opinion you’ve already formed about this author. All that the remaining part of the article needs to do is to fill up past the end of the page so that you believe the riposte/diatribe really exists, and it performs this task with aplomb.

What happens from here is actually rather subtle. The author outlines the position he intends to oppose, followed by “here’s[sic] the facts they’re missing”. But the next few sections, from “Developers, Developers, Developers” to “Why Platforms Win” contain an opinionated retrospective on the computing industry, using links to the author’s own articles as references. Opinionated? Well, count the number of times the phrase “third rate, old technology” appears. It’s actually only four, but it moves from what “IBM, Microsoft, and the PC cloners [Oxford comma sic]” were doing to “the Microsoft strategy”. There’s enough filler (26 paragraphs and 10 linked articles in the same style by the same author) that it could be easy to forget that segue occurred. A fact which doesn’t escape the author:

If you made it this far, you may have forgotten that the first argument against Apple vetoing apps

Too right we might have forgotten. What we haven’t forgotten is that we were told “here’s why” the app store naysayers were wrong, but have actually been told why Lotus 1-2-3 outsold Visicalc. The author’s argument follows the pattern “B follows A. C. Therefore A.” Loosely the argument could be described as a “red herring fallacy”, although a word I prefer is that the intervening text underwent a process known as “contextomy”.

Anyway, before we got here, our author let his façade slip a little:

Now let’s hammer away at the sappy pleading on behalf of developers who want Apple to cater to their whims due to the attractive populist concept of fairness in doing so.

Ooops! Now, do we think that the author is for or against people who disagree with Apple? Anyway, enough backtracking. Why don’t we move forward from the end of my previous <q>?

[…] is that its decisions are unpredictable and arbitrary.

Now read the rest of that section. There’s a good amount of text to describe why these decisions aren’t arbitrary. Whatever happened to unpredictable? Oh, and for bonus points, look for where the final paragraph contradicts the earlier thrust of the section and reinforces the notion that arbitrary rejections have occurred.

The rest of the article carries on in the same vein, and having seen the way in which I automatically parse the earlier part you can probably guess how my cynical mind interprets the rest of the text. Oh, and speaking of cynicism, if you’re still wondering why this is a repudiation and not a refutation, then my evil little mind-play trick worked! You’ve read at least part of every paragraph in the hope to get information I promised at the beginning; if only I’d put some adverts in the post somewhere. So to refute means to prove to be false, whereas to repudiate means to reject. The article we’ve just looked at is an internally inconsistent expression of the author’s opinion, no proof having occurred. It’s also an example of the informal fallacy of suppressed correlative. Apple’s practices can’t be bad, because Microsoft’s practices are bad and Apple’s are better than Microsoft’s.

Well, that was fun! The next time you’re talking to your boss (or better, your marketing people), listen out for those rhetorical devices and remember to stay critical :-).

posted by Graham Lee at 23:09  

Thursday, May 22, 2008

Managers: Don’t bend it that far, you’ll break it!

Go on then, what’s wrong with the words we already have? I think they’re perfectly cromulent, it’s very hard to get into a situation where the existing English vocabulary is insufficient to articulate one’s thoughts. I expect that linguists and lexicographers have some form of statistic measuring the coverage in a particular domain of a language’s expression; I also expect that most modern languages have four or five nines of coverage in the business domain.

So why bugger about with it? Why do managers (and by extension, everyone trying to brown-nose their way into the management) have to monetise that which can readily be sold[1]? Why productise that which can also be sold? Why incentivise me when you could just make me happy? Why do we need to touch base, when we could meet (or, on the other hand, we could not meet)? Do our prospectives really see the value-add proposition, or are there people who want to buy our shit?

Into the mire which is CorpSpeak treads the sceadugenga that is TechRepublic, Grahames yrre bær. The first words in their UML in a Nutshell review is "Takeaway". Right, well, I don’t think they’re about to give us a number 27 with egg-fried rice. (As a noun, that meaning appears only in the Draft Additions to the OED from March 2007.) Nor is there likely to be some connection with golf. All right, let’s read on.

UML lets you capture, document, and communicate information about an application and its design, so it’s an essential tool for modeling O-O systems. Find out what’s covered in O’Reilly’s UML in a Nutshell and see if it belongs in your library.

Ah, that would be a précis, unless I’m very much mistaken. Maybe even a synopsis. Where did you get the idea this was a takeaway? I can’t even work out what the newspeak meaning for takeaway might be. Had I not seen the linked review, I had thought the “if you take away one idea from this article, make it this” part of the article. In other words, if you’re so stupid that you can only remember one sentence from a whole page, we’ll even tell you which sentence you should concentrate on. This use[2] doesn’t fit with that retroactive definition though, because the conclusion which can be drawn from the above-quoted paragraph is that one might want to read the whole article. I would much rather believe that management types in a hurry would remember the subsequent sentence as their only recollection of the article.

UML in a Nutshell: A Desktop Quick Reference is not misnamed.

[1]You may argue that the word should be spelled “monetize”, as the word most probably came from American English, but it doesn’t matter because it doesn’t bloody exist. Interestingly, the verb sell originated in the Old English verb sellan, meaning to give, with no suggestion of barter or trade.

[2]Language usage is the only place I’ll admit the existence of the word usage.

posted by Graham Lee at 23:22  

Thursday, May 1, 2008

The Dock should be destroyed, or at least changed a lot

I found an article about features Windows should have but doesn’t, which I originally got to from OSNews’ commentary on the feature list. To quote the original article:

The centerpiece of every Mac desktop is a little utility called the Dock. It’s like a launchpad for your most commonly used applications, and you can customize it to hold as many–or as few–programs as you like. Unlike Windows’ Start Menu and Taskbar, the Dock is a sleek, uncluttered space where you can quickly access your applications with a single click.

Which OSNews picked up on:

PCWorld thinks Windows should have a dock, just like Mac OS X. While they have a point in saying that Windows’ start menu and task bar are cumbersome, I wouldn’t call the dock a much better idea, as it has its own set of problems. These two paradigms are both not ideal, and I would love someone to come up with a better, more elegant solution.

The problem I have with the Dock (and had with the LaunchPad in OS/2, the switcher in classic Mac OS, and actually less so with the task bar, though that and the Start Menu do suffer this problem) is that their job basically involves allowing the internal structure of the computer to leak into the user’s experience. Do I really want to switch between NeoOffice Writer, KeyNote and OmniOutliner, or do I want to switch between the document I’m writing, the presentation I’m giving about the paper and the outline of that paper? Actually the answer is the latter, the fact that these are all in different applications is just an implementation detail.

So why does the task bar get that right? Well, up until XP when MS realised how cluttered that interface (which does seem to have been lifted from the NeXT dock) was getting, each window had its own entry in the task bar. Apart from the (IMO, hideously broken) MDI paradigm, this is very close to the “switch between documents” that I actually want to perform. The Dock and the XP task bar have similar behaviour, where you can quickly switch between apps, or with a little work can choose a particular document window in each app. But as I said, I don’t work in applications, I work in documents. This post is a blog post, not a little bit of MarsEdit (in fact it will never be saved in MarsEdit because I intend to finish and publish it in one go), the web pages I referenced were web pages, not OmniWeb documents, and I found them from an RSS feed, not a little bit of NetNewsWire. These are all applications I’ve chosen to view or manipulate the documents, but they are a means, not an end.

The annoying thing is that the Dock so flagrantly breaks something which other parts of Mac OS X get correct. The Finder uses Launch Services to open documents in whatever app I chose, so that I can (for instance) double-click an Objective-C source file and have it open in Xcode instead of TextEdit. Even though both apps can open text files, Finder doesn’t try to launch either of them specifically, it respects the fact that what I intend to do is edit the document, and how I get there is my business. Similarly the Services menu lets me take text from anywhere and do something with it, such as creating an email, opening it as a URL and so on. Granted some app authors break this contract by putting their app name in the Service name, but by and large this is a do something with stuff paradigm, not a use this program to do something one.

Quick Look and Spotlight are perhaps better examples. If I search for something with Spotlight, I get to see that I have a document about frobulating doowhackities, not that I have a Word file called “frobulating_doowhackities.doc”. In fact, I don’t even necessarily have to discover where that document is stored; merely that it exists. Then I hit space and get to read about frobulating doowhackities; I don’t have to know or care that the document is “owned” by Pages, just that it exists and I can read it. Which really is all I do care about.

posted by Graham Lee at 00:13  

Thursday, March 6, 2008

My discs have been Americanised!

<

p>For some reason, even though l10n and i18n have been fashionable terms in computing for the last few years, no-one seems able to localise properly into the lingua franca of computing, English. It may surprise some readers to learn that there’s more than one dialect of english, and some of these even have their own ISO codes (such as en_GB, en_US and so on…I’m ignoring the "ang" language for now). Some words in these different dialects are not spelled in the same way. I live in the United Kingdom of Great Britain and Northern Ireland (Land of hope and glory, mother of the free…) and therefore those round things are known as discs. Indeed, when I insert my Mac OS X installer disc, it is called “Mac OS X Install Disc 1”. Then I launch the Firmware Password application, which tells me: “The firmware password is used to prevent others from starting your computer with a different disk.” Gah!

posted by Graham Lee at 21:45  

Powered by WordPress