Sunday, March 22, 2009

A new try

So after the last couple of weeks (months....) I started writing some apps. One of them I will rewrite. Now this is kind of odd, since I only started it some weeks back, but the way that it works just doesn't fit the way I want it to work.

First of all, writing CoreData apps when you haven't completely understood CoreData is a pretty bad idea. I have another app running on CoreData, which I will probably keep on it and try to fix all conceptional errors that I added to it, but for this app, I will rewrite it. Will get me some more experience on how apps were created before CoreData existed and hopefully some insights in how things work a bit more.

The app

The app that I am rewriting is all about Apps and Licenses. I want a combination of something like RapidoSerial, LicenseKeeper and a bit more.
The idea is to have the license data and the apps together. This will keep me from manually taking care of app-backups and clean ups and give me some overview on apps that I tested and didn't like. (Currently I test them and three months later test them again, only to find out that I have already tested them).

First things first
I created a new project, created a Mercurial repository and drafted the UI in Interface Builder. I'm not completely happy with it, but it fits my needs for now.

Next thing is to create a class with all the info. I want to have a directory in the ~/Library/ApplicationSupport folder with the Documents that you can save with it and a customizable folder for application versions. The app itself should save it's data in XML, this way you will always have access to the software, even if the app would not work anymore.

So let's get started 

Distributed revision control

As mentioned before I wanted to have versioning setup when getting into coding again. Subversion was a nice way of doing this while I was working on my stationary computer. I had pretty few overhead by Subversion since I only accessed it via "file://" instead of "svn://" of "http://" but this of course only works good as long as you only work on one computer.

My new toy

So the other day I got myself an old iBook (yes, iBook.... I said old :-) ). Mostly to be a bit more flexible. Having a laptop now changes the situation in regards to versioning. If I would always be in my network I could use it, but I want to use it somewhere else, too. So I found myself a couple of different options:
  • creating another Subversion repository on my laptop and manually copying back and forth
  • changing the Subversion access from file to ssh and configuring my router to be available over the internet
  • changing the Subversion access from file to ssh and not having versioning when not logged in my network
  • changing to a centrally available repository (not in my network)
I don't want my router and my pc to be running all time so option two is out. Option 1 means too much manual work and option three simply disqualifies itself by loosing the one thing that mattes to me.... versioning.

A new concept... at least for me
 
I got reminded of an article that I read some time ago. It was about decentralized / distributed versioning systems. Instead of one central repository that you need online to update your working copies, you can copy the repository to your local computer, work on it and later submit the changes back. All of this with keeping full history.
The idea sounded good as it would enable versioning on different computers, even when they are not connected.
Thinking about this more and more I got reminded that Linus Torvalds (creator / godfather of the Linux kernel) uses one of those systems because centralized systems wouldn't fit the needs.

After some surfing I chose Mercurial for a try. It's lightweight and runs on Mac OS X. The only bad thing about it, is that it does not have any Xcode integration. However it works (just as git probably). And I like it.