Threading is Dead. Long Live Threading!

I stated in a past post that threads are evil. I still stand by that statement. Adding threads to an application has historically been fraught with issues. Many stem from people not quite understanding all of the situations can arise, etc. Oh sure, you might know what a deadlock is, but do you know all the circumstances they can occur? How does one safely shut a thread down? Did the owning object go away? It’s not as simple as it seems in most cases.

But what if I could thread until the break of dawn and not have to worry as much about those situations? That’s exactly what Grand Central Dispatch gives you on Mac OS X, and now iOS — access to concurrency without nearly as much pain. (more…)



If Only I Could Write Like This

I ran across this quote from Oliver Reichenstein, and it embodies my thinking completely, though I’ve never been able to put it into such words.

We should use original tools to create iPad apps, not because Steve Jobs said so, but because these tools create products with flesh and bone, that is: an understanding of both the purpose, the potential and the limits of the iPad technology.

I’ve never been a fan of cross-platform frameworks, even though I’ve been involved in four to speak of to date (not always by choice). I like to think I’m pretty good at it at this point, but even the best of us ends up with mediocre platform support or performance because you’re trying to wedge your idea of the universe onto another. And we know from watching Fringe what happens when two universes meet.



Home Again

Over the past 9 months I’ve been working on iTunes 9. Which shipped 9/9/9. Weird.

As of this week, however, I’m now working in the iPhone group, back in my old stomping ground of building 2. It’s so weird to be back there. It’s been reconfigured a bit since I was there last, but otherwise, it’s the same old place I remember. I was even visiting some old co-workers of mine and noted that my original office was right across the hall. That was (gulp) just over 13 years ago! I think the building was pretty new at the time too (completed in 1993 or so?).

So yeah, I’m in the same building (different floor), and seeing a lot of the old people I used to know. But there are way more new faces than OGs. It all the same, yet different.

But the most important thing in all of this is this: now that I’ve just about settled in I’m starting to have some serious fun. I haven’t looked forward to doing my work this much since… probably since the last time I worked there. Yes, I’ve done interesting stuff and had fun times in between, but this is a whole different level.

I’m home again! :-)



Tweetsville Source Back Home

A few weeks ago, I finally met with the folks at Tapulous to discuss Tweetsville and as of that meeting, I’ve got control of the source once again. The existing app will remain in the store, but the source code is mine to do what I wish. At this point, I’ve been outdone over and over in the Twitter app space, not to mention I still work at Apple, so I’m not 100% sure what to do with it yet. At a minimum I might dole out parts as simple open-sourced thingies people would be free to take and use or improve upon. I guess time will tell.

I do want to take this opportunity to thank the Tapulous guys for their open, honest dealings with me and this situation, as well as their willingness to hand it back to me.



Back at Apple

In my last Tweetsville Update, I mentioned that there was something that might prevent me from working on Tweetsville going forward, despite the fact I just finished it. Well, that thing has finally materialized so I can finally say that I’m officially back at Apple starting today. It’s been weeks in the making, but it finally materialized late last week.

This time I’m working on iTunes instead of the OS group. Definitely a different type of thing than I’m used to — I’m more a framework/API type of guy — but I think it will be fun nonetheless. Especially since I’ll be working with one of my friends that I used to work with there.

Because it’s Apple, I’m under strict agreement not to have any type of side projects, etc. so it was important to find someone to care for Tweetsville from this point forward. It’s too cool of an application to just let it drop. Especially since I just added Flickr upload support and the ability to quit the app while typing a tweet and have it pick up where you left off next time you run the app this week (both should appear in some future release).

Anyway, that’s the close of this short chapter of my life, and the start of a shiny brand new one!



Tweetsville Update

Just wanted to post an update as to what was happening with Tweetsville, my iPhone Twitter app.

First, it’s been approved for sale! But I haven’t seen it show up and sadly I don’t have a link to it. Read on for why.

The main reason the app was delayed so long coming out is because I had been been trying to figure out exactly what to do with it. I might be in a situation soon that will actually prevent me from being able to maintain the application, so I wanted to see if I could find a good stewart for my baby. I’ve chosen to hand the application over to Tapulous, maker of Tap Tap Revenge, Twinkle, FriendBook, Fortune and Collage, with whom I have a good working relation.

I think this is going to be great for Tweetsville, as they have better resources at their disposal to help support and grow the application. I also think they have some technology which can help Tweetsville be even better than it is. At the same time, there’s some stuff I did for my app that I believe will benefit Tapulous.

There is no plan to have Twinkle and Tweetsville merge. They are to be separate applications with separate audiences. Twinkle is about locality and the Tapulous network, and Tweetsville is purely a Twitter application.

One of the advantages here for users is that there will be choice. There will ultimately be two versions of Tweetsville. The first will be a paid version currently slated for $3.99. The second will come a few weeks later and will be a free ad-supported version.

I’m confident this will move is the best thing for the Tweetsville app as well as users in the long run. You’ll get more choices and better support than I would have been able to provide on my own. I feel the app is in good hands, as I have a great working relationship with Tapulous (I’m actually doing a little work on Twinkle 1.3 these days too).

So look for it to appear in the App Store on Monday the 10th of November!

Update Actually the date is apparently going to be the 12th.



Tweetsville

Well, it’s been about two months since I left Yahoo! and I’ve been spending pretty much literally all my time working on an iPhone application. It’s nothing super flashy, mind you, but I feel it is the best app of its kind. I had been really disappointed with all the Twitter apps for the iPhone. Either they were too slow, or scrolling was poor, or it just didn’t work the way I did. So I set out to write the version I’d want to use. I ended up with an application called Tweetsville. I’ve been putting together a small site for it here, so you can check out the features there. I also have set up a Twitter user you can follow if you care.

I had three goals in mind, in this order:

  • Totally responsive, with glassy scrolling.
  • Embrace the natural aesthetics of the iPhone user experience.
  • Use the full power of the Twitter API.

It’s definitely fast and smooth (though admittedly it could be tweaked a bit more), and it looks like a real honest-to-goodness iPhone application. For whatever reason, I thought it would be ideal to do this app using as many standard (or standard-looking) controls as I could. The less custom stuff the better.

But the real beauty is the fact that I cache as much of your Twitter stream as I can get from the API, coupled with the depth of what you can do with this application. You can see your timeline, do direct messaging, see your favorites, history, and replies. You can also see the latest trends and do searches, including advanced searches. It is without a doubt the most powerful Twitter iPhone application I’ve seen to date. Of course, I’ve had my head in the sand for the past 8 weeks!

Will this application change the world? Hell, no. But I think it will definitely make a dent in the Twitter space. And it was fun, which was really my whole main point of writing it. It’s been a long while since coding was fun.

Even with all it does, there is still other things I’d like to do to it to improve the functionality and ease of use beyond what’s there, but there are only so many hours in the day, and I’m burnt out from coding so much. I need a vacation from my vacation!

The real question is: should I even charge for it? I’m currently thinking no, but man, it might really take off, and then I’ll be missing out. If I don’t charge for it, I will likely make the source publicly available. I’ve already got a subversion repository set up and ready for some sources if I do. Or there’s always code.google.com.

I’m hoping this will get submitted very very soon. My last build seems to be pretty stable, and I’m too paranoid to make any real changes now.

Wow, this would be the first thing I’ve ever written and released like this since… Aaron (if anyone remembers that). Again, wow.



Software Development Meme

I’ve been tagged by Seldo, a former colleague from Yahoo!

How old were you when you first started programming?

I believe I was probably 16 or so. I was in high school and we started learning on Radio Shack TRS-80s and Apple IIe’s. It was in high school when I saw what the Mac was and desperately wanted one. But hell, they were pretty expensive. It would be a few years before ever getting one.

What was your first language?

BASIC, on the aforementioned platforms. GOSUB FTW!!

What was the first real program you wrote?

The first real program that I wrote and ever sent out into the wild was called DoubleScroll. It was an extension for Mac OS that would give your scroll bars two arrows at each end. It wasn’t the first of it’s kind, but my version worked with System 7 as well as 6. It took a lot of sitting in Macsbug to figure out that the System 7 scroll bars got a new, undocumented call to allow them to draw the scroll box outline. Bastages!

What languages have you used since you started programming?

In no particular order: Basic, Pascal, Cobol, DBase, Perl, Java, shell scripting, C/C++, Objective-C, PHP, SQL.

The most interesting fact is that when I was working during college, I worked at a store that did all their database stuff in Basic as well.

C I learned completely on my own trying to learn Mac coding. This was just as C was becoming popular. I didn’t have the cash to dish out for MPW and all that fancy stuff at the time, so I got Think C.

I know C/C++/Objective-C best and probably PHP second best. But it’s far second.

What was your first professional programming gig?

This was at a company called Charles River Analytics. They worked on a piece of Mac software called Open Sesame. It watched what you did and used real honest-to-goodness AI to find patterns and offer to automate certain sequences. I came on to work on the monitoring piece, since by that time I had a decent amount of experience patching the OS with INITs. By the end of my time there, we had Undo working in the Finder. Yes, it was a flying hack, but it worked!

Of course, after I got to Apple, my viewpoint of patching the OS changed dramastically(tm).

One of the cool things about being there at the time was a) it was when the Internet opened up and b) we got to visit Taligent. It was from Taligent’s use of C++ that we learned a lot. It really opened our eyes as to how it could really be used. They had actual real templates back then. Like, our compilers couldn’t even compile stuff they did. Of course, it was the slowest OS I’ve ever seen, so it didn’t completely sell us.

If you knew then what you know now, would you have started programming?

Oh hell yes. It’s one of those really addictive things that sucks me right in. It’s just too cool to be able to code something up and show others. Especially these days with the stuff I’ve learned over the years.

If there is one thing you learned along the way that you would tell new developers, what would it be?

Wow, only one? Well I’m giving you three!

  1. Don’t do ‘surface coding’. Always strive to understand what’s really going on underneath some APIs if you can. I find that it really helps me get my head around the way a frameworks, etc. is put together. Sometimes, when I see something odd, I’ll write little tests to kind of see what it’s really doing. Sort of a black box model, I guess.
  2. Never assume you know how things are going to perform, or what’s slow and what’s not. You’d be surprised.
  3. Be lazy. Don’t do anything in your code that you don’t need to do. This was a huge thing we learned at Apple, and it made huge differences in performance (and perceived performance). I swear I could write a book from all the things I learned while there.

What’s the most fun you’ve ever had… programming?

I’ve had many fun times, I enjoyed doing that first DoubleScroll extension as it was such a learning experience both in terms of tech as well as dealing with customers, etc. It was also exciting to be sent a book with a check or the software from Michael Crichton.

My time as Apple was very fun, as was some parts of my Yahoo! experience (the Atlantis – Konfabulator 4.0 project).

But I have to say, the iPhone app I’m working on now has been a lot of fun. Probably the most fun I’ve had coding in a long long time.

Who’s next?

This is a tough question, actually. I think I’m going to tag Daniel Jalkut next! Since I wrote this in MarsEdit, I felt it was fitting :-)



CoreGraphics is Right After All

A while back I wrote about a potential issue with compositing using Quartz. I’m happy to finally conclude that there in fact is no issue. Yes, Quartz does behave differently than Cairo, but I believe Quartz has the more consistent behavior throughout all its modes. I came to this realization after talking to the engineer who does the compositing work in Quartz.

The main difference is that Quartz will only ever touch pixels within the ‘clip’ of an object, whereas it seems that Cairo will touch pixels outside of it. After thinking about it for a bit this makes much more sense, and seems to be a much simpler thing to implement as well, so I’m not sure why Cairo seems to take the tack they do.

So for example, if you fill a circle in Quartz, only the pixels inside the realm of influence (the circular path itself) will have the Porter-Duff blending applied. This is why things look different in Safari and Firefox when using these modes in a canvas object.

I reported in my prior post that I thought that it should affect pixels outside the circle, but this no longer makes sense to me after talking with that engineer. Now, if you were to blit an image of the circle, the area of influence would be the image rect (intersected with any clip, obviously). Then you’d get results more like what you’d expect. So basically, once you know that fact, you can likely still do most of the things you’d want to do using these blend modes.

So in the end it just seems like limiting the blending to the effective clip area is the better method. It’s far simpler to implement, since much like painting the circle in say, source over, you only affect pixels inside the circle. Ever. And that is a constant through all composition modes. This makes it consistent and predictable.

So in the end, it’s right, as far as I’m concerned (and Apple, of course)!



Limbo

I’ve recently left Yahoo! after 3 years there. I already miss hanging out with everyone, but it was clear to me that the best thing for me was to get out and find my own path.

I got to Yahoo! through the acquisition of Konfabulator (now Yahoo! Widgets). It was an interesting experience to say the least. I think I could write a small book on my time there. That might be the topic of a future post here. Suffice it to say, I don’t think it went as well as it could have.

But this post is about my current state of limbo. Not quite anywhere right now. It was definitely a little risky to just leave my job and take some time off. I’ve never had the opportunity do it before, and I have a few irons in the fire regarding what to do next, so I figured I’d give it a go. This way, I can really be free and clear to refocus myself and know what I really feel about what I want to do next.

So far it’s been a pretty good time off. I’ve mostly been working on my own iPhone application. I won’t say what it is yet. It’s nothing super-special, but it’s turning out pretty sweet. I know I will use it every day, maybe you will too. I have no idea if I’d even charge for it or not. If I did, maybe it’d be a buck or two. But that’s not even really in my head right now. I just want to finish it!

I’ve really been enjoying coding for the iPhone. Yes, even though it’s Objective-C :-) The only annoyances for me have been the bugs I keep running into. I’m a good boy though and I write them up for Apple. Heck, I even sent in a test case for one. Fortunately, most of them to date have been duplicates they know about. Hopefully they’ll get squared away soon.

As far as what to do next, I’ll keep meeting with people over the next few weeks and hopefully we can figure this out. While I am enjoying my time to myself, I certainly can’t keep this up indefinitely! Maybe I should be an Indie developer for iPhone/MacOS. Then I can stay home and survive.

Stay tuned.