Thursday, September 29

Finding Value in a Formal Directory Structure

While a language like Java generally requires a very formal directory structure (packages map directly to directories) other languages are not so lucky. If you're writing C, C++ or Objective-C, directory structure is not really forced upon you. For the most part, it is something you impose on yourself, the compiler simply needs to be able to find the files in its include paths.

To that end, I don't espouse that everyone adhere to Java's directory structure, but on the other hand, I don't suggest you drop all of your XIB, plist, .h, .m, .png, .project and *.xyz files into the root directory of your project either. Instead, find a middle ground and organize your files in a simple but consistent directory structure. I prefer to separate files by their type and not generally by their function. For example, I wouldn't consolidate files associated with the login function into one directory. Instead, I save images to an 'images' directory, view controllers get a separate directory as does the datamodel implementation. I generally keep resources separated from class files and I further separate resources by their type (resources/images, resources/xibs, resources/strings, …).

Whatever structure you use, think it through, set it up early, adhere to it throughout, and fix it as you go along. You'll thank yourself later when you can find files intuitively instead of having to search for files that sound like "<your controller name here>".

Distributed Sync Is Hard

How do you get the goat, the lettuce and the lion across the bridge?

Too easy? Ok, you've got an iPad, an iPhone and a web application. Design a system that allows you to sync any device with any other device.

Yet Another Algorithm Blog

I created an algorithms blog to help study these bad boys.

Check it out and fix my errors :)