Rails Test Prescriptions Blog

Keeping Your Application Healthy Since 2008

Category Archives: Apple

Stevenotes

I wasn’t going to write this, because it’s not like the Internet has a dearth of people writing about Steve Jobs who never knew him or interacted with him in any way. I wrote it anyway.

I’ve watched the first few minutes of the keynote introducing the iPhone several times. It amazes me – both as a seminal moment of technology and as a presentation. Jobs starts of by saying he’s been looking forward to this day for two-and-a-half years, and that he’s been fortunate to work on multiple “revolutionary” products in his career.

He says that “Today, we’re introducing three revolutionary products” – remember this part?:

  • “A widescreen iPod with touch controls” – he says, and the crowd goes nuts.
  • “A revolutionary mobile phone” – the crowd goes berserk, this is what they came for.
  • “A breakthrough internet communications device” – polite applause, but really, nobody knows what the hell he’s talking about.

He repeats the phrases, makes it clear that he’s talking about one device, “and we are calling it… iPhone”. Then he shows a gag picture of an old iPod with a rotary dial, and it’s funny – not a phrase normally associated with Jobs’ keynotes.

It’s a fantastic performance. Here’s the thing… People went crazy for the iPod and phone parts. Almost five years later, there’s no doubt that that part that nobody got at first – the internet communicator – is far and away the most revolutionary part of the iPhone experience. I had a phone in my pocket before 2007. I had an iPod in my pocket before 2007. The biggest change to my behavior from the iPhone is the way I can access the Internet from my pocket. (Yes, I know there were mobile phones that could connect to the Internet before the iPhone. I even used some. It wasn’t the same thing in an way.)

Which makes me wonder, why describe the device as an “internet communicator” at all, let alone have it as the last part of the description? I mean, it’s nice to have three beats in description, but the build from iPod (yay!) to phone (YAY!) to “Internet communicator” (huh?) is certainly weird. I assume that the “Internet communicator” part is there because somebody – presumably Jobs – felt that it was going to be important. Placed it last because it was most important. Even if nobody else realized that yet.

It’s been interesting to see how Jobs has been described in media reports, and how none of the descriptions quite fit. “Inventor”, “pioneer”, “visionary”, “technology titan”. They all have a grain of truth, but it’s almost impossible to imagine a short phrase that could encapsulate exactly what Jobs’ role was in all of these revolutionary products. At this point, the glib, writerly thing to do would be to claim that “Internet communicator” is the phrase that fits. It’s tempting, but kind of forced.

I used to say this: “Apple is a long-range experiment in how much people will pay for good design. And the answer is not much”. I said this for years, probably first around 1994. It’s become less and less true over the past few years, not because Apple is any less a design experiment, but because the audience has finally caught up with them and more and more people have been willing to pay for devices that are well designed. Jobs was the curator of that design sense, and that design sense has shaped the tools I use and the way I live and work.

Advertisements

August 4, 2010: A couple of useful things

Book Satus

Still patching the Shoulda chapter together. Realized yesterday that Machinist is in the middle of a version 2 upgrade, which, along with some factory_girl changes probably means I have some tweaking to do in that chapter.

I haven’t run the buy links in a while. You can get the beta ebook and pre-order from Pragmatic and the book is also available from Amazon.

WindyCityRails

Early Bird pricing for WindyCityRails is scheduled to end today. I’m doing the PM tutorial on “Testing In A Legacy Environment”. Please sign up, I’d hate to talk to myself. Also watch WindyCityRails for another speaker announcement that should be coming up very soon. There’s already a great lineup, and they run a super-great conference.

Links

This is handy given what I’ve been doing this week. Christoph Olszowka has made a bash completion script for RVM commands. I wonder if it will work in my zsh shell.

Speaking of useful tips, on the off chance that anybody stumbles across this who doesn’t read John Gruber, he has a useful OS X service for opening all the URL’s in a selected text as separate Safari tabs.

Former Apple engineer Sachin Agarwal, now at Posterous, lists some things he learned about project management from his time at Apple.

July 21, 2010: This Code Belongs In A Museum

Status

Not much to tell, really. Spent some time getting RVM set up, since I think I’ll need it to manage simultaneously building the Rails 2 and Rails 3. Now I have a working version of the startup appendix that uses Rails 3 and Devise. I can’t speak to using Devise in practice yet, but the immediate goal of making the setup less complicated was definitely accomplished. The big question now is how much to support Rails 2 in the walk-through chapters. I’m leaning toward just having the walk-through chapters be Rails 3 with only occasional notes on how Rails 2 differs.

Links

Apple has allowed the code for the 1984-era MacPaint and QuickDraw to be released to a museum where anybody can download and peruse. QuickDraw is all in assembler, and MacPaint is a mix of Pascal and Assembler. At a quick glance, the striking thing about the MacPaint Pascal is that it actually seems quite readable. The layout is consistent, it’s commented, variable names have meaning, that kind of thing. Certainly miles ahead of any Pascal code I wrote back when I wrote Pascal code…

This is kind of a cute way to find hidden puts statements by raising exceptions. The project I’m on actually monkey patches puts to add a line to the output saying what file and what line of code the put statement is on. Surprisingly useful.

Claudio Maral has a couple of examples of cleaning up controller code by moving logic to the model.

Oh — Droptext got updated. It’s a universal iOS app for 99 cents that lets you edit files on Dropbox. This release, I think, makes the app functional. Some crash bugs were squashed, and you can now specify alternative text extensions. It’s still pretty simple (I’d love to be able to change the display font, and I’d really love TextExpander integration), but it works and I’ll definitely be giving it more of a spin.

The Ruby Hoedown has announced its speaker list for September 3 and 4. I’ve never been, but I’ve heard good things, and you won’t find a major conference that’s less costly.

July 15, 2010: An Apple Comment A Day

Book status

Still writing the legacy chapter. Totally coincidentally, Michael Feathers, author of Working Effectively With Legacy Code, just wrote on an issue similar to what I’m dealing with right now: The Bad Code Kata. I imagine Feathers had a similar problem when writing his book about legacy code.

An Apple Comment A Day

So Apple is apparently holding a press conference Friday about iPhone 4, although they haven’t officially confirmed that it’s about the antenna issue.

By the way, I keep seeing dark speculation about why early reviewers of the phone didn’t see this issue. Though I do think the tech press isn’t always pure, I don’t think you need to invoke a conspiracy in this case. I assume that since the phone was in an NDA that it was being used in a case a large percentage of the time to hide it, which by most accounts sharply reduces the issue. Also, Mossberg’s early review did mention an intermittent service drop (3rd and 4th paragraphs from the end) — he just wasn’t able to diagnose it. Which doesn’t excuse Apple from finding the problem, just means we can probably rest the conspiracy talk in this case.

As for me, I still can’t get over how great the screen is, but I think my expectations got raised too high on the still camera — I’m getting more grain than I expected in places that I wouldn’t have considered low light. Still, it’s a big improvement. As I said, I can reproduce the antenna issue, but it hasn’t yet been a practical problem for me.

Links

Josh Owens has a short but sweet post on how to pick an open source tool when there are multiple options available.

Here is a slide show on how enumerators work in Ruby, it comes from a talk by Rein Henrichs, but is pretty easy to follow even without the speaking.

Antony Marcano has a brief historical anecdote on the history of the term Waterfall as applied to software.

July 7, 2010: Dylan Goes Electric (Probably Not True)

Book Status

Beta 4 should be available this week, or at the latest Monday, apparently we’re working around people’s vacation schedules. It will have two new chapters, and some error fixes and tweaks around the book.

Next is on to Beta 5.

In status news that shouldn’t interest you much, the end of the quarter meant the end of my first Pragmatic pay period. And apparently Pragmatic pays as soon as possible, rather than waiting 30 or 90 days after the end of the pay cycle. That’s pretty great, from my point of view. Again, no reason why you should care.

Links

Envy Labs is announcing Ruby Tracker, the Ruby Dependency Manager. Basically, you give Ruby Tracker your code repository, and it analyzes your gem dependencies and notifies you when any of them are updated. Sounds interesting. I wonder if it might be most useful when first taking over a legacy project to see just how out of date it is. (Not that I would necessarily recommend updating a legacy project first thing, but it’s good to see exactly what you are up against…)

A new beta of RubyMine 2.5 is now available. The big Rails feature is support for LESS CSS. Also, Mac users now have a native file directory, which is nice in that the old one was a pain in the neck, as well as a couple of other Mac-ish tweaks.

Mark Guzdial, over at the Computing Education blog links to some older articles by the one-and-only Alan Kay about the promise of spreadsheets and the like. Reading the kinds of things Kay was doing and speculating on 25 years ago or more is humbling — the rest of the world hasn’t quite caught up.

I linked to the first two parts of this yesterday, here’s part 3 of Kent Beck’s survey data on testing. This one is how often those surveyed run unit tests, with just over half running them on every code change.

I like this pattern — here’s Bogdan Gusiev with a custom RSpec matcher to test validation for ActiveRecord. (The code is here) The matcher lets you say things like it { should accept_values_for(:name, "Fred", "Jim") } and it {should_not accept_values_for(:name, "23", "M&Y". That’s nice because it makes the test independent of the validation code being used.

Jay Fields has a post talking about what keeps Java developers from adopting Ruby or Clojure, and how they don’t yet realize that the power of the languages and of command-line interactive terminals will overcome the relative lack of IDE support, which matches my experience pretty much exactly.

Finally

This article summarizes some rumor chatter going around that Apple is planning on either replacing Objective-C or offering another language as a full alternative for the creation of say, iOS applications. Just a couple of points. I suspect that this is at least something that Apple is researching — they’d be crazy not to. Apple already supports MacRuby, so the idea that MacRuby could target iOS isn’t completely insane. Still, wouldn’t it be wonderful if they went back to the future and started supporting Dylan? Nothing would cement the “iPad is evolutionary Newton” theory more…

Apple Intern: 1995

It’s kind of hard for me to believe that it’s fifteen years ago this week that I reported for my three-month internship deep in the research department at Apple Computer, down in One Infinite Loop.

It was 1995, and it’s beyond understatement to say that Apple was a totally different place then. (I just read an article by a tech pundit who really should have known better that Apple’s marketing has always been great. Not true — the general awfulness of Apple’s marketing circa 1995 was a constant frustration for Apple fans of the time.) The vibe was a little downtrodden and nervous. The stock, I remember pretty clearly, was in the 20s. And I think it has split since then.

I’m still not completely sure what I was doing there. I was in Apple’s educational research arm, which doesn’t exist now, but at the time education was a big market for Apple, and they were a player in research as well as the actually putting computers in classrooms part. The overall goal of this project, if I recall, was to create an ecosystem of dynamic educational objects or models that could be grabbed by teachers to use in various lessons.

In practice, we were working with an experimental Apple programming environment called SK8, which was kind of an object-oriented HyperCard, with a Smalltalk like “live” programming environment. SK8 took 32 MB, that’s M for Mega not G for Giga, of RAM, which was a crazy luxury at the time. Apple’s laptops maxed out at 36 MB at the time. It was a serious problem — I couldn’t take my work back to Georgia Tech to demo because they did not have a single Macintosh in the lab with that much memory.

There were about 15 of us, mixed between contractors and grad students from various educational technology programs. We were in a long, narrow room, with basically a narrow aisle separating the sides. Our perk for being placed in the long room was a bunch of Nerf toys that the admin assistant attached to our group would occasionally refresh (“I’m going on a Toys R Us run, who wants something”). Nerf fights would occasionally break out along the room.

Some specific things I remember.

A manager attached to the team saying that it was inevitable that Apple Computer would one day drop the “Computer” from its name. Why? Because “this” is not a computer, he said, holding up his Newton. That manager went to Netscape shortly thereafter. Netscape was a big deal that summer, their IPO, which was the start of what became the dot-com boom, happened in August. It was a front-page story in the San Jose paper, and I remember feeling weird to be in an industry town and be in that industry.

This was the summer that Windows 95 came out, effectively ending an era in which Apple was visibly different from Microsoft’s OS. I won a t-shirt that said “Windows 95 = Mac 89” for making suggestions about how to market Apple’s products.

Day of Win95 launch, Apple had an anti-launch party in the courtyard of Infinite Loop, which I remember included a guy demonstrating broken features of Win95, to a crowd that was perhaps a bit over-enthused by the fact that Win95 acted badly when a directory path length exceeded 255 characters. It was a weird vibe.

There were a lot of company parties of one kind or another, probably about one every other week or so — this week, the latest QuickTime version went golden master, that week, a general overview of upcoming stuff. People who had been there a while said that it was nothing compared to what things had been like in the late 80s, so I can’t imagine what they do there these days.

The cafeteria on site was pretty good, but I most strongly remember the museum that had a running version of every thing Apple had put out to that point, from the Apple I, through the current Mac, and including things like the Lisa.

Apple has a company store on-site, at the time it was their only retail outlet, and it had something that you still can’t get in current Apple stores — Apple-branded merch. Though, they gave out t-shirts like candy (I wound up with something like ten in three months), so I didn’t have to buy very much.

Biggest difference between then and now is probably that, even though I had a laptop, I literally never went online outside of work. (Which would have been via dial-up). The programming tool I was using voluntarily was Smalltalk Agents.

I sort-of met Don Norman, who took over as head of research during that summer, I think. Ditto for Woz, who I’m pretty sure gave some kind of talk to all the assembled interns throughout the company. I’m pretty sure the Smalltalk guys who eventually released Squeak (Dan Ingalls, Alan Kay) were at Apple at the time, but I can’t remember if I saw Squeak then or later.

We gave our final team demo and report in one of the Town Hall rooms at Infinite Loop in front of a smallish group of other demos, all of us wearing matching white t-shirts with the rainbow Apple logo.

It was a fun summer. I was there for a short enough time that it didn’t stop being cool to be working at Apple.

June 2, 2010: How To Test Good

Yesterday…

Gave my talk at Chicago Ruby. The video is already online — yay Chicago Ruby team. I was pleased with it, actually, I did pretty much what I hoped to do, except that I thought the repetition joke would get a bigger laugh.

In other news

Yehuda Katz posted slides on another Rails 3 talk: dashing to the finish.

Speaking of people on stage, Steve Jobs was interviewed on stage at the D conference yesterday. Among other, more important things, Jobs admitted that the initial iPhone-ish prototype was tablet sized.

Saw this on Twitter just now, and it looks nice — a node based console app for speaking HTTP. Looks like that’d be handy in almost any web development toolkit.

David Turnbull has a new Tumblelog called I Suck At Ruby, looks like he’s got some useful short bits and good advice for sucking less. I’ve also got Everyday Rails, by Aaron Sumner (Tip to everybody: make your actual name more prominent on your blog…) Both of which remind me that it’s time I put more original content here…

May 13, 2010: The Rules of Agile Estimation

Top Story

JRuby 1.5 is out. Highlights include improved Rails 3 support, better support for Windows, better FFI support, better startup time (yay!) and a lot of other tweaks and fixes.

Book Update

Still Cucumbering, hope to finish today.

The book is still on sale, of course. And I’d still love to see more comments in the forum.

I’ll be talking at Chicago Ruby on June 1, exact topic TBD (let me know if you have a preference), but I’m leaning toward talking about how to avoid test problems and write good, robust tests.

And Then…

As an unrepentant old Newton fan, I loved this compare and contrast of a recent iPad ad with an old Newton ad. The Newton, flaws and all, was way ahead of the market back them.

If you are going to RailsConf, first of all have fun and wish I could be there. Second, if you are wondering about the difference between the two Rails 3 tutorials, wonder no more.

Kent Beck is publishing some old pieces again, including one about how the original XP book made the mistake of equating “the team” with “the developers”.

Fred and George Weasley are marketing experts.

And Finally

The Rules of Agile Estimation:

1. Estimates are always wrong

2. If you think spending more time on estimates is a good idea, see rule 1.

3. On average, an experienced developer is not going to improve on his or her gut reaction by thinking it over.

4. Team estimates are important, one person may see something that everybody else missed. Just keep it quick.

5. People are much better at estimating size relative to each other than absolute time a task takes.

6. Separate the problem into smaller chunks, the more estimates you make the better the chance that the law of averages will help you.

7. Decomposition into roughly equal sized tasks is pretty much the whole ballgame.

April 16, 2010: The cover is uncovered, at least for me…

Top Story and Book Update

I have sample cover designs. I don’t think I can show them yet, but I’ve got ’em, I like them, and hopefully we’ll have picked one to show shortly.

Tab dump

Not a whole lot today:

Here’s a look at the current status of using a non-blocking MySQL driver with Rails. The promise here is for significantly faster database access.

Two stories that are related to projects that I worked on back in my EdTech days:

Version 1.0 of Pharo has been released. Pharo is a fork of Squeak smalltalk aimed at, as far as I can tell, a more modern UI and setup. Pharo is also the reference implementation for the Seaside web framework. A lot of Ruby and Agile ideas came out of the Smalltalk community. I’d definitely recommend trying Smalltalk if you are looking for a new language. For years, I’ve given impromptu Squeak demos to show off what’s cool and what’s hard about Smalltalk. Check it out.

On a less encouraging note: Scratch, which is the current MIT media lab project to teach programming ideas to kids, had their iPhone app pulled from the app store yesterday. (The link is to Mark Guzdial’s compututing education blog — Hi Mark!) This is probably collateral damage in Apple’s war on interpreters, but there’s no way to put a good face on — it’s a disappointing decision and I’m sad I didn’t know Scratch was there to download before it was pulled.

Finally

Part Two of the 8-Bit Dr. Horrible is up — when you start the flash player, you have the option of clicking into act two, which I mention because it took me too long to figure out on my own.

April 13, 2010: iAd, youAd, weAll Ad

Top Story

iPads. Lots of them popping up in and around work. Probably some more coherent impressions coming later.

Wait, once again, Twitter has a big announcement after I start writing this. This time, they are going to start placing ads in the Twitter stream in various ways to be announced today. My quick reactions: a) I long suspected this day was coming, b) if the ads in clients are any guide, they aren’t particularly burdensome, c) implementation details will decide how irritating this is.

Book Status

Still working on Webrat and Capybara. Still waiting for a cover. Somewhat doubtful that the beta will happen this week, but I haven’t been told that for sure.

Tab Dump

Charles Nutter puts out an open call for help with the pure Java port of the Nokogiri XML parser for use with JRuby.

Confused by ==, equal?, and === in Ruby? You won’t be after this article.

Hey, it’s another big-time Agile founder: Ward Cunningham being interviewed. Pull quote: “When you’re doing it well it feels a little plodding, you’re not racing ahead like you might do on your own. But what happens is that it never slows down.” Can I get that on a T-Shirt?

Yehuda Katz is turning his attention to more Bundler documentation, with two articles that went up as I started typing this. The first one lays out the problems bundler tries to solve, and the second talks a bit more about problems specifying the order of require statements.

Rails Rx Standup: April 12, 2010

Top Story

For a while, it looked like the top story was going to be Apple’s new developer Rule 3.3.1, described here by John Gruber. More on that in a second.

But the real top story is the news that Twitter has bought Tweetie, intending to rebrand it as Twitter for iPhone, and dropping the price to a low, low, free. Eventually, it will be the core of Twitter for iPad. Wow.

Tweetie is probably the only case where I actually prefer the iPhone experience to the desktop experience, but I’d also be very sad if Tweetie for Mac was orphaned. (Not least because I just bought the MacHeist bundle in part as a way to get the Tweetie Mac beta sooner…). Later update: Tweetie developer Loren Brichter said on the MacHeist forum that the next Tweetie/Mac beta will come out.

I actually suspect that at least some of the existing iPhone Twitter clients will be able to continue — there’s clearly room in the ecosystem for apps that have much different opinions than Tweetie. It depends on how aggressive Twitter is planning to be. Dropping Tweetie’s price to free strikes me as agressive, although it may just be that the Twitter team is averse to direct ways of making money.

As for the Apple story, it’s a familiar space. Apple does something — in this case, blocking apps not originally written in C, C++, or Objective-C — that might have a reasonable user or branding component (keeping the iPhone platform free of least-common-denominator cross-platform apps) and taking it just too far for users or developers to be comfortable with it. That’s, of course, an understatement, as a lot of developers are really angry. Gruber’s point about the Kindle apps is good (and was later cited by Steve Jobs), but on the whole, I think this is a bit to far for Apple, or maybe I’m just upset that that the door seems to have been slammed on MacRuby apps for iPhone ever being feasible.

Book Update

Still working on the Webrat/Capybara chapter. Describing two tools that are so similar is really challenging for me — when there’s a difference, keeping it clear which tool is under discussion.

Also I’ve got the probability that I’ll have an article in an upcoming issue of the Pragmatic Magazine. This will probably be based on material from the book, but edited to fit the magazine article format. Probably either factory tools or mocks. Or maybe Ajax testing. Haven’t decided yet.

Tab Dump

Don’t think I’ve mentioned this yet, but here is a cool presentation of RSpec tricks. Some of these don’t work in RSpec 2, though.

While we’re on the presentation kick, here’s a nice intro to Git from James Edward Gray.

If you’ve ever tried to deploy Agile in a hostile environment, then the recent This American Life episode about the General Motors/Toyota NUMMI plant will resonate for you.

And Finally

A comparison of a boatload of Ruby test frameworks, being used in Iron Ruby to test some .NET code. I admit that I was not familiar with all the frameworks used here.

Rails Rx Standup: April 9, 2010

Book Update

Not much to report. Still messing with the integration test chapter. Also still waiting for cover possibilities.

Tab Dump

Continuing the RailsEnvy story from yesterday, today Jason Seifer posts some more details. This essay is more personal. I wish Jason nothing but good things.

In a somewhat ironic counterpoint to Gregg and Jason writing about Rails envy, it was widely reported today that Justin Long thinks the “I’m a Mac” ads, of which he is the right-hand half, are over and done.

In general Ruby news, we’ve got http://www.rubythere.com/, a minimalist site that lists upcoming Ruby conferences, and rubyproblems.com, which is Gregory Brown’s new site providing in-depth solutions to interesting domain problems.

TDD pioneer and RubyRx hero Kent Beck, has put up an unedited screencast about TDD. “Test Driven Development is intended to help programmers take more responsibility for the quality of their work”. It’s a little rough around the edges — it’s unedited, and it’s in Java. But it’s Kent Beck, talking about TDD, so go watch it (especially the first couple minutes, which are more general). Notice how small each of Kent’s steps are.

Finally,

You may have heard that Apple had another announcement yesterday, this time for iPhone OS 4.0. The big one is obviously the structured multitasking. I’d like to thank Apple for allowing the iPad to overshadow most of the pre-announcement speculation about iPhone OS, leaving us with only the months of post-announcement speculation. Some of which I plan on indulging in.

Everybody’s doing it: Bullet Points and the iPad

iPad, iPad, iPad. Five Random Thoughts

  • Given that Apple’s business model for most of the past 30 years has been not to compete on feature lists, but rather to pare down features in the name of user experience, that a tech analyst would at least pause before proclaiming the iPad to be a failure because it doesn’t have feature X.
  • I don’t think the iWork stuff got enough attention. In particular, I could see Keynote being a big deal. It has less text entry and more object manipulation than Pages, and with video out, it turns the iPad into a pretty nice presentation tool.
  • A lot, though, will depend on whether the soft keyboard is something that a touch typist can reasonably use — I wouldn’t expect it to be as fast as a full keyboard, but if I can get in the ballpark, then this becomes useful for a wide range of tasks. Just to throw a couple names at random, Scrivener and MarsEdit become plausible iPad apps if typing is reasonable.
  • Do I need one? Which is a different question from do I want one. Right now, the WiFi only seems too restrictive, and the 3G version seems too expensive. Some mechanism by which the iPad could use an iPhones 3G connection (outright tethering, or possibly a connection using the local bluetooth to share files) would be very nice.
  • I don’t have any special insight, but I wouldn’t be surprised if leaving off a front-facing camera was a pure human factors play. It seems highly likely that getting a camera in place to do video chat on this thing would be a pain.