Which two buildings are across the street from my current location?
and
anyone might think it had been deliberately chosen for comedy purposes…
Which two buildings are across the street from my current location?
and
anyone might think it had been deliberately chosen for comedy purposes…
Leopard has now been out for nearly a year, which means that (publicly) we’ve had Objective-C 2.0 for the same amount of time. At the release many developers were champing at the bit to talk about the new language capabilities[], including properties. There were arguments on both sides of the divide, and even a little bit of discussion. But now that we’ve been using these things for a while, and because I’m bored awake grouchy vocal opinionated, let’s have a look back at what they’ve given us.
There is a broken abstraction in traditional Objective-C, which is the accessor-method-as-property-declaration. Essentially an object can give you two things; work (i.e. it can do stuff) and state information (i.e. it can say stuff about itself and let you change it). In traditional object-oriented languages, because ‘saying’ and ‘changing’ are verbs which can be ‘done’, the two have both been expressed using the same method (heh) as the expression of work. This is not the case in much object-oriented design, for instance in UML a class always has separate “attributes” and “operations”.
Properties fix up this abstraction by giving us orthogonal ways to express the two concepts. Work is done in methods; state is got/changed in properties. Now it may be that the state information is actually backed by a method (although it may bang on the ivar directly; more below), but we don’t need to know that any more than we need to know in the interface that a property is synthesized or dynamic. All we do need to know is that it is there for us to use, and has certain attributes such as being read-only.
The “on more below” bit is that discussions of KVC-like mechanisms – such as KVC :-) – often involve someone pointing out that they break encapsulation, because it’s possible to access an @private ivar with no accessors by retrieving it by key. That’s really thinking about the design of a class in terms of the way it’s executed rather than its interface contract with the developer, because the @private ought to tell the developer not to touch that particular ivar. Properties neither help nor hinder breakage from the execution side, but from the design side they do provide a stronger distinction between “properties I’m telling you about in the interface” and “things you shouldn’t touch”. Now we can all get back to using the class’s interface to observe how to use it, and that C struct bit at the top to observe how to extend it, as nature intended. It’s both a blessing and a curse that Objective-C allows things to appear in source files which don’t make it into the executable code, but that doesn’t stop such information being useful to the developer in the same way that code comments can be read but not executed.
One of the popular complaints about ObjC properties is the syntax for referring to them in methods (OK, or indeed in functions), where it is argued that myObject.someProperty = 4; doesn’t readily tell you whether myObject is an ObjC object, a C struct or a C union. That seems to be at worst a straw man argument to me, and at best a hypothetical issue; in well-designed software it will be rare to mix code at various levels of abstraction except in limited circumstances such as adapter classes. Besides, if the code has been written such that it can be inspected or reviewed (i.e. to some agreed style and standard) and the reviewer is paying attention then it will be easy to distinguish use of the various types. At some conceptual level the C . and Objective-C . operator are doing the same thing anyway; they’re both saying “this attribute of that thing”.
[]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.
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 :-).
AppleScript isn’t something I write much about, in fact this is the first post I’ve ever created on the topic. But AppleScript, like the Services menu and Automator, provides that most useful of usability enhancements: the ability to use multiple applications together without fulfilling the marketing requirements of having to look at them all.
As an example, a folder action script might let me combine the Finder with any other application, such as, choosing completely at random, Sophos Anti-Virus:
set theScript to "/usr/bin/sweep -nc"
repeat with i from 1 to number of items in these_items
set thePath to POSIX path of item i of these_items
set theScript to theScript & space & thePath
end repeat
set theScript to theScript & space & "--quarantine:mode=000"
do shell script theScript
end adding folder items to
that script then scans any file which appears in a particular folder and locks it if it contains a virus (up to a point). But that’s not really the point, the point is that I haven’t actually had to use any of the target apps in order to get this combined functionality. It’s like I was able to summon the Megazord without having to actually talk to the individual Power Rangers. Erm, or something. And that, really, is how a computer should work; I didn’t buy OmniFocus so that I could look at its icon, or a splash screen, I bought it because it can manage my lists of things to do. And I got iCal in order to manage events in time. If I have things to do at specific times, then I ought to be able to combine the two, and the computer can do the work involved. After all, that is why I bought the computer.
I own a notebook. In fact, I own several notebooks. One in particular has an interesting feature (where I use “feature” in the “different from the competition, though we don’t know whether anyone actually needs it” sense); inside the front cover is space to write your address, and a dollar value reward available to the person who returns the notebook.
Now the notebook itself is probably worth about $20, but on the face of it a used notebook is worth less than a pristine notebook, with a full notebook having no value. Presumably the value of the reward should be related to the value of the notes contained within it, and therefore can’t be ascertained until I’ve filled the notebook up. But then if I were to lose it before filling in the pages, I would not have entered an interim value; and if I had then whenever I made new notes I would need to update the worth of the book.
And who should be footing the bill, anyway? Are my musings of any financial benefit to me, or if my employers get more worth from them should they be contributing to the reward fund? Could I possibly make the same notes again were I to lose this book? Could I pay someone with a lower salary than mine to have thoughts with a similar monetary value? Would someone else who came across my notebook be able to extract the same worth from the contents than me? If so, should I write in an encrypted fashion? How much more would that cost me? Should the reward factor in the costs of decrypting the contents, possibly reverse-engineering the method if I’ve forgotten it?
Do ideas depreciate? Clearly patentable ideas do, will my ideas be patentable? Will I be able to benefit from the patents? If someone finds the notebook and returns it, are the ideas still patentable? What about non-patentable thoughts, do they all depreciate at a constant rate? Should the reward value be a function of time?
Clearly the only people who can answer all of these questions upfront, and therefore the people who can use this reward feature with confidence, are the people whose ideas can be modelled with a waterfall development process. Take Terry Pratchett; he might know that the content of one notebook equates to roughly 50% of a novel, and that each novel is worth £200k, and therefore the value to him of the notebook is less than £100k. A thought process which eventually results in a cash value for a notebook. For those of us whose ideas are somewhat more iterative (read: chaotic), this seems like a complete misfeature.
Title linky goes to a Sophos blog post I wrote about the relative success of MobileMe phishing scams, and the insecurity of MobileMe web access.
So, my few-year-old iPod decided it had had enough, and with pay day having only just passed I thought maybe it would be nice to get a new one. What’s happened today? Got the new one home, and it won’t work at all (searching for “error 1434” isn’t particularly useful, either). However, the one that previously broke, having now been taken apart, started working again. So my 20GB 4G iPod is now humming along nicely (running Podzilla), and my 160GB classic is b0rked :-(.
Yup, more on the subject of a home-grown Twitter client. This time, posting and sorting out the UI somewhat have both been achieved:

Posting tweets is amazingly simple – just take the tweet and stuff it into the body of a POST NSURLRequest. The Twitter API even handily returns the posted tweet, so the same code which parses the friends timeline can also insert the new tweet.
So, where to go next? Well, I’m getting bored of typing my password in all the time so Keychain would be nice, @reply buttons and perhaps searching. I’m going to need cache management soon, too.
I found today in Macintouch reader reports the news that a Mac user found his Gmail account had been taken over. He writes:
I woke up this morning and looked at my gmail and thought, gee that’s weird, it won’t accept my password. I figured it was a glitch and tried it on my iphone, same thing.
Then I asked for a password reset. When I got back into the account, found a bunch of sent emails from a Nigerian scammer. I also looked at the ip history in gmail and noticed the weird IP, which of course came from Nigeria.
This relates well to a point I’ve made repeatedly in podcasts and papers; namely that having information worth stealing is not a Windows-only situation. As more data is stored "in the cloud" then the security of the cloud and of the way we use it becomes as important what is going on in our own computers. Having a weak Facebook password compromised will work just as well if you’re on Trusted Solaris as Windows.
In other news, yesterday’s Twitter client is not really much further along, because a thunderstorm has meant I’ve unplugged all of my electronics (the laptop isn’t plugged in to anything, obviously). I am now very grateful to MarsEdit for having offline editing capability, otherwise I’d have to try and remember all this stuff later ;-)