cURL error 7: Failed to connect to 69.163.177.34: Network is unreachable
Or try one of the following: 詹姆斯.com, adult swim, Afterdawn, Ajaxian, Andy Budd, Ask a Ninja, AtomEnabled.org, BBC News, BBC Arabic, BBC China, BBC Russia, Blogdigger, Brent Simmons, Channel Frederator, CNN, Crazy Apple Rumors, del.icio.us, Digg, Diggnation (Odeo), Diggnation (Video), Dominic Sagolla, Dooce, Flickr, Google News, Google Video, Harvard Law, Hebrew Language, InfoWorld, iTunes, Japanese Language, Korean Language, MacNN, mir.aculo.us, Movie Trailers, Nick Bradbury, OK/Cancel, OS News, Phil Ringnalda, Photocast, Photoshop Videocast, Romanian Language, Russian Language, Traditional Chinese Language, Technorati, Think Secret, Tim Bray, TUAW, TVgasm, UNEASYsilence, Web 2.0 Show, White Collar Ruckus, Windows Vista Blog, Yahoo! News, You Tube, Zeldman
inessential.com
Brent Simmons’s weblog.Subscribe: Bloglines, Google Reader, My MSN, Netvibes, Newsburst
Newsgator, Odeo, Podnova, Rojo, My Yahoo!, Desktop Reader
Less code, less effort 4 Aug 2011, 10:55 pm
Here are a few things I’ve been doing lately to write better code, and less code, with less effort.
Synthesized instance variables
Adding a property is costly when you have to declare it three times: once as an instance variable, once (or twice) as a property, and once with @synthesize.
Last year I had tried synthesized instance variables, where you only have to declare it as a property and with @synthesized. I remember being disappointed because the synthesized variables didn’t show up in Xcode’s debugger.
Then I tried it again the other day, and the variables appeared. Somehow I’d missed the memo that it works now.
I promptly went through and deleted all the instance variables from my app. They’re now all synthesized.
Automatic Reference Counting (ARC)
For anyone who’s been writing Cocoa apps for a while, manual memory management is second nature. Me, I don’t even think about it. Errors are extremely rare (but they can happen).
I took a few hours the other day and converted my app over to ARC. That meant deleting a whole bunch of code: no more retains, releases, and autoreleases.
I also deleted a whole bunch of dealloc methods. (When I had to keep a dealloc method, it was just to remove the object as an observer.) If you think about it, dealloc was, in a way, yet a fourth place where you had to declare a property. (Once as ivar, once or twice as property, once using @synthesized, and once in dealloc. Crazy. That’s the kind of thing that makes programming a chore.)
Less work, less chance of error. ARC’s cool.
valueForKey on arrays
If you write code that works with a database or via web services, there’s a good chance you’re dealing with unique IDs of some kind, and there’s a good chance you need to get an array of those IDs sometimes.
The way I used to do this:
NSMutableArray *arrayOfIDs = [NSMutableArray array]; for (RSFoo *oneFoo in someArray) [arrayOfIDs addObject:oneFoo.uniqueID];
There’s an easier way:
NSArray *arrayOfIDs = [someArray valueForKey:@"uniqueID"];
This isn’t particularly new, but I used to always forget about it. (Obviously, it’s useful not just for unique IDs. I just mentioned that because it’s a common case for me.)
Configuring rather than coding
My app makes 25 or so different calls to our platform. I wrote this as one base class and 25-ish subclasses.
That’s not wrong, but it totally and completely sucks. It means 50 files to manage. It means creating two new files and coming up with a new class name every time I want to add a new call — and it means a new chance for errors and bugs.
What I noticed about these subclasses is that they only two do things:
Configure the call before sending it. (Set the HTTP method, set the URL, add parameters to the right places.)
Turn the result into an object. (Usually that means taking the result of the JSON parser and turning it into a model object.)
I’m in the middle of getting rid of all these subclasses. Instead, each API call is defined by a struct, and those structs all live in a single file.
const RSAPICallSpecifier kGBAPICallDownloadNotifications = { .httpMethod = kHTTPMethodGet, .path = "notifications/", .returnType = RSHTTPReturnTypeJSON, .returnedObjectClassName = kGBNotificationParserClassName,
etc...
I could have used a plist or something else. The point is that how-the-API-works is a form of data, and I can separate that from the code that talks to the server. That makes it easier to make changes and additions. It means less code to read and write and manage, and fewer chances of errors.
(For bonus points, our API description would be on the web in some parseable form, and I’ve have a script that downloads that data and then rebuilds those structs, and also alerts me to what’s changed. Not a new idea, no.)
Blocks and GCD
I don’t mind the formality of delegates and protocols — except that it does mean more typing. There are plenty of times when creating an API that takes a block will save a whole bunch of work and be just as clear, if not more clear. So I do.
I’m a big fan of NSOperationQueue, but it usually means creating a class, overriding the right methods, and so on. There are times when GCD will do instead. So I use that also.
Here’s how I split it up: I use NSOperationQueue when I have something somewhat long-running. I want to set priorities and dependencies, and I want to be able to monitor and potentially cancel operations. The main use is for downloading things: making calls to our server, downloading thumbnails and images, that kind of thing.
But I’ve slowly come around to seeing that there are cases where GCD is perfect for me. An example is rendering images — for instance, if I want to create an image with rounded corners and a drop shadow, I do it in the background via GCD. There’s no need to monitor these or be able to cancel them.
NSCache
It may be my best friend. I toss in rendered images, text measurement calculations, strings that are expensive to calculate, etc.
I used to have all kinds of different caches, and now I use NSCache almost exclusively. (There are rare cases where I might use an NSMutableDictionary or NSMutableSet.)
It’s super-easy to use — like an NSMutableDictionary, it responds to objectForKey:
and setObject:forKey:
.
Particularly cool is that an NSCache handles removing items itself. I don’t have to think about it. It means fewer things I need to do when getting a memory-warning message.
Xcode 4 text snippets
I was bummed at first to lose the Xcode scripts menu. (My hope is that I can replace the features I miss via AppleScript and FastScripts.)
But having the text snippets is way better than the previous system for adding completions. Drag some text in, give it scope, title, and completion shortcut, and you’re good. It works, and it’s worth doing.
(There are a few things I wish for, though. User-entered snippets should be at the top, not the bottom, since they’re probably more important. And it’s silly that to remind myself of a completion shortcut I have to double-click the item and then click Edit. It should just be part of the display in the table. [I’m a developer. Please don’t make me click so much.])
Some things I still wish for
I wish I didn’t have to use @synthesized. I’d love to be able to declare a property exactly once.
I wish Xcode’s autocomplete would still work before I’ve imported the header file for a class that it totally knows about. It means I have to stop my typing, go to the top of the file, import the right .h file, then try to find my way back to where I was. (The back command should work after a cmd-upArrow.)
I wish Xcode would just add import statements for me when it’s unambiguous. (I’d wish away header files and imports entirely if I could.)
I wish I didn’t have to delete the DerivedData folder when things go wrong. I wish I didn’t have to delete xcuserdata when Xcode stops being able to keep up with my typing (on an 8-core Mac Pro).
I wish I could type someArray[0]
and have it mean [someArray objectAtIndex:0]
. Similarly, I wish I could type someDictionary['someKey'] = someValue
.
I wish dot notation worked all the way through, as in someView.frame.size.height = whatever
.
I could go on and on. Which is just to say that things are getting better — we’re able to do more with less work — but there’s always room for improvement. Gives me something to look forward to.
I hate videos 8 Jul 2011, 11:24 pm
Except for these ones of talking animals.
“The maple kind...” Cracks me up.
Design Podcast 7 Jul 2011, 7:23 pm
I just subscribed to Iterate, a new podcast on iOS, Mac, and Android design. I haven’t listened yet, but I expect it to be good.
TwizShow 21 Jun 2011, 10:11 pm
My friend Mike Zornek just wrote me about his new game TwizShow. Yep, it’s a Twitter game. (Not a game about licorice, which was my first guess.)
Shawn on RSS and Twitter 20 Jun 2011, 10:52 pm
Shawn Blanc ran a survey on RSS and Twitter usage and makes some good observations. Nice work.
Gopher dead, blogging lives 16 Jun 2011, 2:04 am
Gopher still exists, I think, technically. But it never caught on the way the web did, and it’s safe to say that it’s pretty much dead. WAIS too is an ex-parrot.
But blogging? I hear sometimes that blogging is dead.
No, really. It’s something people say.
I’m reminded of Internet World, Los Angeles, 1997. By the year 2000, said some people’s wisdom, there will be only a half-dozen or so websites. PathFinder and a few others.
Right.
Facebook, Twitter, the usual suspects, as always
When people say that blogging lost out to Facebook and Twitter (as they also say about RSS), I think they’re talking about those kind of personal, diary-style weblogs, where you report on your latest cocktail and post pictures of your shoelaces.
I think they’re also talking about the traditional linkblog, where you just post links with a sentence or so of commentary.
If those have moved from blogs to social media, does that mean that blogs are dead?
Those links that appear on Twitter or Facebook rather than on linkblogs — to what are they linking?
We’d have to invent them
New blogging systems like Posterous and Tumblr seem to be pretty popular, and they fill a nice middle ground: short content, easy sharing, social stuff. They’re cool.
But try to imagine replacing Daring Fireball, Scripting News, Apple Outsider, Shawn Blanc, or any of a number of great blogs with something like Twitter. You can’t. You’d have to invent blogs so that these writers have somewhere to write.
If blogs are dead, what are we reading in Instapaper?
If blogs are turning into places for more thoughtful writing, rather than as the only place to share stuff, I think that’s awesome. We have a more diverse, interesting, textured set of web-tools than we used to. That’s good.
Death of an idea
Here’s what’s dead: the idea that everybody should have a blog.
I’m totally cool with that. Makes sense to me. But that’s a long way from meaning that blogs are dead.
What we talk about when we talk about RSS 15 Jun 2011, 11:30 pm
(Disclaimer: I started working with RSS even before creating NetNewsWire nine years ago. I still very much want NetNewsWire to succeed. But know that I don’t speak for NetNewsWire or for its new owner, Black Pixel.)
Varieties of RSS
When we talk about RSS, we’re talking about one of several things:
The syndication format called RSS. Sometimes people also mean Atom when talking about RSS.
RSS as hot topic of conversation.
RSS as plumbing.
The feed-ification of the web.
RSS readers, such as NetNewsWire, Google Reader, FeedDemon, and so on.
People sometimes say that “RSS is dead,” that it lost to Twitter and Facebook. They don’t always specify what they’re talking about, so I’ll look at each meaning of “RSS” and figure out which ones are dead.
And then I’ll play you out with a song.
RSS as format
RSS and Atom output is a standard feature of web publishing systems. New sites and new blogs means new feeds.
I don’t how to demonstrate it, but I think it’s self-evident that as the web grows, the number of feeds grows, so that there are more feeds now than ever.
Not-dead as format.
RSS as hot topic
RSS has been around 15 years or so. Pundits used to be excited about it ushering in a brave new world of airborne unicorns. The unicorns stayed home, where it’s nicer.
Dead as hot topic. (I’m glad about this, in case it’s not clear.)
RSS as plumbing
I subscribe to podcasts in iTunes — those are RSS feeds. Xcode brings me updated documentation via RSS. Every Mac app that uses Sparkle to deliver updates uses RSS. A zillion iOS apps read RSS feeds, even though the word RSS never appears in the app.
Boring. Useful. Not-dead as plumbing.
Feed-ification of the web
Twitter and Facebook timelines are feeds. They could be expressed using the RSS or Atom formats specifically, but often they’re JSON. It amounts to the same thing: lists that update with new content over time.
The concept of the feed has been amazingly successful. Not-dead as generic “feed” concept.
RSS Readers
I think this is what people mean they say RSS lost to Twitter and Facebook.
Let’s set aside the notion that the links that people post on Twitter and Facebook have to come from somewhere, and in many cases those links came via a person who uses an RSS reader. I don’t have any idea how to quantify that, and I don’t know what its importance is.
I suspect that a world with Twitter but without RSS readers is a place with fewer links and more cat photos. (I like cats, so it wouldn’t be all bad.)
(And then there are things like Twitterfeed which republish RSS feeds on Twitter.)
Here’s what I think is actually dead: the notion that software that makes you subscribe to feeds that you run across in your browser will ever cross the chasm.
It’s just too geeky for most people.
We can be forgiven for hoping that wasn’t true in 2002, when the geek-level of the average internet user was higher than it is now.
But we know better in 2011. (We’ve known better for years now.)
One way forward for RSS readers
Even still, the number of people who like RSS readers as they are is pretty high. They’d like them to be better, yes, but in the sense that people always want their software to be better.
If those news-junky geeks are just a single-digit percentage of the total market, that’s still a ton of people (at least on Mac and iOS). You can build a business and make millions of dollars with an RSS reader.
So that’s one way forward. Build a great RSS reader, then buy a beach-house.
The more interesting way forward for RSS readers
Here’s the song I promised.
The software’s job is to bring people articles that they’d like, or need, to read. Think of the app as a reader, not as an RSS reader strictly. (How the articles come in is not important. RSS will still play a major role, but it should be invisible to everyone except those geeks who get it.)
The user interface has to evolve to be much less email-like, and everything has to get way easier than it is now.
At the same time, any given reader needs to know where it lands on the entertainment/productivity spectrum. There are beautiful, fun UIs that aren’t efficient, and there are efficient UIs that aren’t much fun to use.
Then use a mix of recommendation, discovery, and relevance to bring people the articles and media they want. Social media play a giant role here, as does more formal curation and technologies like latent semantic mapping.
Beauty and fun and efficiency and discovery and relevance add up to delight.
Do-able? Sure thing. You bet. Five years ago it was very difficult. Today it’s do-able.
So that’s the second way forward.
Make a great reader, then buy an island in the South Pacific.
Dead?
Yes and no. It’s plumbing, and, behind-the-scenes, RSS is doing a lot more work than most people realize, outside of RSS readers.
We understand the limit of the appeal of a traditional RSS reader. The idea that those apps as-they-are-now could become mass market hits is finished.
They can still be modest hits, though, and ambitious and smart developers will go well beyond the traditional RSS reader and make reader apps that will become mass-market hits.
And those reader apps will still make great use of RSS, but the RSS-iness will become invisible plumbing.
Summary: it’s complicated, but “not-dead” is the correct answer.
Text rendering 14 Jun 2011, 10:29 pm
The only bad thing I can say about the iPhone retina display is how it spoils text rendering everywhere else. Text on my iPad and Macs is blurry in comparison.
Given that text rendering on Macs isn’t as sharp as retina displays, it strikes me as borderline sadism when I use an app that doesn’t use subpixel anti-aliasing.
Tim on NetNewsWire 11 Jun 2011, 11:44 pm
Tim Bray’s counting on Black Pixel. Me, I’ve got no doubt. I just wish there was a magic wand and they’d have new versions already. Now I know what it’s like to be an impatient NetNewsWire user!
But I know that software takes time, so I’ll wait.
(And I’ll remember that the things I wasn’t able to do, or that I wasn’t able to do well, were matters of not enough time. Lack of time is the ugly toad.)
WWDC Party List app 4 Jun 2011, 4:30 am
I just learned that there’s a WWDC Party List iPhone app. Of course there is!
Marcus Zarra on community 4 Jun 2011, 4:20 am
Cocoa Is My Girlfriend: “Sadly though, it is the older, established, members of the community that are turning so hostile. Gone is the sharing and the live/let live attitude that once made this community so great.”
My first thought on reading this was to wonder, have I recently been less-than-excellent toward any of my fellow developers? I can’t think of anything off-hand, but it’s possible. I can be a jerk, or dumb, or just oblivious, like anyone else.
The people who should know better, the older, established members (like me), are responsible for the community, and we get the community we create. What I’ve always liked about this community is that it recognizes that developers are people and not products.
Each person has a consciousness and each person has feelings. Don’t forget that. It’s not nothing.
NetNewsWire acquired by Black Pixel 3 Jun 2011, 7:42 pm
It was the thrill of my career.
I expect to have more thrills, but none exactly like that, none so surprising, with me so green, with so many good things to learn still ahead of me.
I never wanted to give it up, that first success and that good feeling of keeping it going. I slowly came to realize that one person couldn’t keep up with all of it, though, and that hanging on forever wouldn’t be fair to the software and the people who use it.
So I found it a great new home at Black Pixel. I can’t imagine a better home, and they’re going to make NetNewsWire great. I can’t wait to see it!
I’ve worked with Black Pixel a bunch, more than enough to know they’ve got a high-energy team and they’re serious about engineering, design, QA, and making high-quality software. And they’re fans of NetNewsWire who are totally revved-up about taking it to the future.
Some of the guys I’ve known for years: I have a bunch of good friends there. Most of the company is here in Seattle. Their office is on Queen Anne, next neighborhood over. (They’ve promised me I can come and visit NetNewsWire’s new home any time!) They’re small-but-growing, already an indie success story.
I’m enormously proud of head pixel and rocket scientist (no kidding) Daniel Pasco and the company he’s built.
Imagine turning over something you created and then worked on for nine years. You’d want to be damn sure it was going to the right place.
I did.
I’ve given myself permission, as I should, to look back over the whole thing, the good and the great, the mistakes, the sloggy days and the fantastic days. I could wish for one thing or another, or dwell on errors, but I’m not going to.
I’ll allow myself to say to myself, "Brent, good job. You created an app that was successful beyond your dreams. You worked damn hard and you had fun."
Sheila had fun too, by the way, during the Ranchero Software years. And she deserves a round of applause for working so hard and well. She loved it.
Of all the many, many things I’ve learned in the past nine years, it’s that the best part isn’t money or winning awards or the small fame that comes with a successful app, it’s when people write to say they love the software.
If that was you, then thank you. That meant so much to me. You kept me wanting to make it ever better.
Every single one of those notes was and is a treasure.
Another thing I loved was my beta group. Many of them have been on the list for the entire nine years. Best beta group ever. (They were very nearly co-developers who just didn’t happen to write code.)
I start new things. More about those later.
If you want more details about NetNewsWire, check out the interview on Daring Fireball. I share the interview with Daniel Pasco (if you can call my verbosity "sharing") — and Daniel’s the guy you want to listen to about NetNewsWire, not me, because he’s the guy with the team that’s going to make it rock harder than ever.
Way harder. And I am so psyched. NetNewsWire’s best years are still to come.
Best, shortest WWDC tip ever 3 Jun 2011, 1:01 am
In other years I’ve posted a list of WWDC tips — which I do mostly as a chance to tease Kevin Ballard. (I don’t know why I do that, except that I think Kevin’s awesome and I like teasing him, knowing that I’ll see him soon.) I’m letting Kevin off the hook this year.
Instead I’ll quote my co-worker Nick Harris from an internal communication, giving advice to another co-worker who’ll be attending his first WWDC. Nick’s words:
“Remember every handshake.”
That’s it. Any other good advice is just the above re-stated a bunch of different ways. (Or padded with Kevin-Ballard-teasing, which is fun but not, strictly speaking, useful.)
Push IO Acquires TapLynx 2 Jun 2011, 7:08 pm
Push IO is the perfect home for TapLynx. I’m so pleased.
Congratulations to Joe Pezzillo and Dan Burcaw and team!
I have no doubt they’ll make me proud, as Daniel has done with MarsEdit. And I can’t wait to see what they do.
Fantastical released 20 May 2011, 11:06 pm
It happened a few days ago, and I was heads-down, so I missed it. If by any chance you missed all the other links to Fantastical, here’s another one.
Half of Flexibits is Michael Simmons. There are those who say we’re cousins, some who say we’re brothers. (Our origins are shrouded in mystery, but I can say that we were both at hand for the invention of papyrus. And Pythagoras stole Michael’s idea, for which he’s still a bit miffed.)
I like to think I’m Michael’s evil twin. But I have more hair, so there’s that.
Family business aside. Fantastical makes dealing with your calendar less tyrannical. Enter new calendar entries using English, instead of beating up your tendons with a bunch of mousing and clicking and mis-mousing and mis-clicking.
When I say “English” I don’t mean AppleScript English — I mean the real thing. It works! Feels like deep magic from beyond the dawn of time.
And the app looks great. It’s a pleasure to use.
Hype up 20 May 2011, 10:54 pm
I’m so excited to see Hype released. It’s what we’ve needed.
I can write code. Not scared. Do it all the time. But if an app means I don’t have to, and I can iterate faster, and do things I haven’t learned how to code yet... then I love that app. Which I do.
NickH on Exceptions 10 May 2011, 9:40 pm
Exceptions are Exceptional: “I’ve run into so many webservices that return HTTP STATUS 200 OK with an html body that says ‘400.’ If you’re doing this, you suck.”
Dave on Twitter and flow 10 May 2011, 8:43 pm
Scripting News: “The good stuff is already outside of Twitter and flows into it.”
TouchUp 1.2 10 May 2011, 8:29 pm
My friends at RogueSheep released TouchUp 1.2 a week ago — and I was a little busy at that moment and missed linking to it.
It’s a cool update to a cool app. New features include deeper Flickr integration, new filters such as Pixelate and Vignette, and support for AirPrint.
The app is gorgeous, and it’s one of those great apps that make the iPad a creation device, not just a fancy movie-player.
Page processed in 0.655 seconds.
Powered by SimplePie 1.1.1, Build 20080315205903. Run the SimplePie Compatibility Test. SimplePie is © 2004–2025, Ryan Parman and Geoffrey Sneddon, and licensed under the BSD License.