The Daily Shoot

(Mon Dec 07, 2009) [/Photography#

I love to make photographs, and yet I don't practice the craft and art of photography enough. Now and then I'll get on a shooting kick for a few days. It's usually when the family gets together, the light is perfect, the weather is dry and warm, something extraordinary is happening, or someone asks me to take a picture. While I'm shooting I always learn something new, and hope not to forget it. Then, after those images are tucked away, my camera gear will collect dust for weeks on end. And the next time I pick up my camera, it feels like I have to relearn everything again.

Getting better at photography, like any craft, takes practice. That's a lot easier said than done. When exactly do you practice? What do you shoot when you're practicing? How do you stay motivated? These are tricky questions, and sometimes it's easier to just do nothing. Whenever I'm faced with this scenario, I find it helpful to follow a simple daily routine. No grandiose plan or unrealistic time commitment, just a little something every day to keep the momentum. And that's what The Daily Shoot is all about.

The Daily Shoot is a simple routine that encourages the daily practice of photography. The idea was hatched with my good friend and photographer James Duncan Davidson (backstory). Here's how it works: Every day at 9AM EST a new photo assignment is tweeted to the @dailyshoot Twitter account. Today's assignment, for example, is to make a photo with a blue theme. Use your big camera or the one you have in your pocket, it's up to you. Then to share your photo, upload it to your photo sharing site of choice and post a tweet that mentions @dailyshoot with the assignment's hashtag and a link to the photo (example). Easy! Now you know when to practice and what to shoot. Your photo doesn't have to be a masterpiece and there are no prizes. The point is simply to help you pick up your camera and make a photograph every day. Practice.

When you're practicing, it's often inspiring to see what other people are doing if only so you don't feel alone. So this weekend we launched a revision to the companion web site to help out with that. No account necessary—it's all driven from Twitter replies! You can catch up on all the assignments and view all the photos submitted for a particular assignment. You can also check out all the photographers who have participated. If you'd rather get your daily assignments via RSS, there's an RSS feed for that. And if you have suggestions for future assignments, please let us know! (Thanks to Patrick Lenz and Urban Hafner for some of the code that powers the new site!)

I've been having a blast with this, both with taking pictures and building out the site. I find I'm seeing the world differently as I look for a photo that meets the assignment each day. I notice things that I otherwise would have missed. I'm also feeling more comfortable with my camera than ever before. Some of the assignments really push me to try new techniques, and even the easy assignments can be made more challenging. Plus, I'm just loving being able to see what everyone else is doing every day! It's inspiring to see how other photogs interpret an assignment, and I'm learning a lot from them.

You can start today! It's easy: Keep your eye open for something blue, and make a photo. Upload it somewhere, reply with a link, and you've joined The Daily Shoot community. Tomorrow we'll have another fun assignment to help you practice. We'd love to have you join us!

iPhone on Rails Interview

(Tue Nov 03, 2009) [/iPhone#

While at the 360iDev conference, Dan Grigsby of Mobile Orchard arranged short podcast interviews (MP3) with a number of attendees. He asked me to give an overview of my iPhone on Rails talk, and we ended up chatting about how to choose between various Objective-C libraries to communicate with REST data sources. My part starts in around 16:00, but they're all well worth listening to.

Enjoy!

iPhone on Rails

(Tue Oct 06, 2009) [/iPhone#

I find myself living in two worlds these days. On one hand, I'm a web programmer writing centralized applications mostly with Rails. On the other hand, I'm an iPhone developer creating mobile applications. My iPhone apps live in my pocket; my web apps live on the 'net.

Sometimes I want the best of both these worlds: mobile applications that periodically exchange data with their mother ship in the sky. In fact, one of my first iPhone apps was a companion to a Rails app that I'd built many years ago. Suddenly I had a way to access some of our small-business data while on the go. Then recently I started working on a new iPhone application that ended up needing a backend web app to share data with a larger community. Along the way, I hacked up a couple prototype applications just as learning opportunities.

I gave a tutorial on what I've learned at the 360iDev conference last week. The short version is that REST conventions make this type of integration a lot easier. For the longer version, I've posted the tutorial presentation and sample projects:

  • iPhone on Rails (PDF): This being an iPhone developer conference, I started with an overview of the REST conventions in Rails. Then, to get the iPhone app talking to the Rails app, I incrementally coded a solution starting with a simple, hand-rolled library and ending up using the excellent ObjectiveResource library. You kinda had to be there...

  • Expenses: A bare-bones, no-frills iPhone app that creates, reads, updates, and deletes a single resource (expenses) living in a scaffold-generated Rails app. It's a simple example of how to use ObjectiveResource. I deliberately left out any bells and whistles so they didn't get in the way of the fundamentals. (screenshot)

  • Budgets: Something a bit more realistic. This iPhone-Rails app combo manages budgets and their related expenses (nested resources). It also demonstrates a few techniques you'll want to consider in your application, including asynchronous networking, authentication, and error handling. (screenshot)

Of course, you don't have to use Rails or ObjectiveResource. Sometimes a JSON parsing library and a Sinatra app are a better fit. Or perhaps Django is more your style. The point is that conventions matter.

I thought I'd share these resources in the event they give you a jump-start on your next project. I may screencast the tutorial if there's enough interest. (Vote by leaving a comment!)

Enjoy!

Xcode Shortcuts Cheat Sheet

(Tue Jun 23, 2009) [/iPhone#

If you're programming in Xcode, it pays to know some keyboard shortcuts. Of course, there are a ton of shortcuts you could learn. And some guys know them all. I'm not one of those guys. I tend to use a fairly small, high-impact set of essential shortcuts. Through repeated use on my day-to-day work, they become automatic. Then once in a while I'll discover a new shortcut, and if I use it often enough it'll stick.

If you're feeling a tad overwhelmed by all the Xcode shortcuts, here's a place to start: my Xcode keyboard shortcuts cheat sheet. It's relatively short by IDE cheat sheet standards (only 45 shortcuts), and I like it that way. It's the sweet spot for what I can remember. And by focusing on just these shortcuts I've become a lot more productive in Xcode. These are the same shortcuts I teach visually in my Becoming Productive in Xcode screencasts. The best way to see how I work in Xcode is to check 'em out!

On a related note, here's a chance to practice your Xcode shortcuts: Attend an iPhone Studio this summer! We have two courses scheduled in August—in Reston, VA and Denver, CO—covering the new iPhone 3.0 SDK. I think it's the best way to quickly get up to speed on iPhone development. Every time I've sat in on one, I've learned something new from the instructors. It's a fun 4 days of hands-on programming, and we promise you won't go away hungry.

MacRuby Screencast, and an iPhone Studio

(Wed May 06, 2009) [/Ruby#

If you're a faithful Rubyist with a Mac, you owe it to yourself to check out MacRuby. It's an implementation of Ruby 1.9 that runs on the Objective-C 2.0 runtime (the two languages share a common ancestor in Smalltalk). That means you have the full power of Ruby and all the Objective-C and Cocoa frameworks at your fingertips. And unlike RubyCocoa, with MacRuby there's no bridge to cross. So there's a lot of potential upside when it comes to performance. And I prefer the MacRuby messaging-sending syntax over the style used in RubyCocoa.

So, in hopes of helping spread the good word, I've put together a free, 20-minute MacRuby screencast.

Now, MacRuby is still a work in progress. I've found the current version (0.4) to be quite stable for Cocoa development, though I've run into problems using RubyGems that have C extensions. Nevertheless, I continue to be impressed with MacRuby. And there are some exciting developments on the horizon, including a new virtual machine based on the LLVM compiler. Does that mean you'll be able to use Ruby to write iPhone apps some day? Only Apple knows. But given that MacRuby relies on the Objective-C garbage collector (which isn't on the phone), I'm not holding my breath. In the meantime, I think MacRuby is going to become increasingly popular, especially among Rubyists interested in building Cocoa apps.

On a related note, we've opened registration for the next iPhone Development Studio in Reston, VA on August 4-7. We're hoping that by delaying it until a while after WWDC that iPhone OS 3.0 will be released. This is a fun class, and a great way to quickly come up to speed on iPhone development. Plus you'll learn Cocoa patterns and techniques you can apply to your MacRuby application. Come for the phone, stay for the Cocoa!