Tuesday, July 22, 2008

SVN vs. GIT: Why not jump into the battle?

So much has been said of this little battle that I can't help but put my oar in as well.
For those of you who don't worry about these things, SVN (subversion) and GIT are Source Code Management programs/systems/whatever. In a nutshell, they allow programmers to make sure they 1.) always have the latest version of a project their team is working on and 2.) are able to roll back to an older version if the new version turns out to be fatally flawed.

The major difference between SVN and GIT is the nature of the "repository" or common storage that each uses.  SVN resides on a server that all team mates can get to, and they each check out a copy of the code, make their changes, and then commit their changes back to the repository when they're done.  GIT is the same, except each programmer checks out the entire repository and makes changes first to their local "clone" and then eventually merge those changes back to the central repository, where they are propagated to all the other team members.

All this is good and fine, but from a user's perspective the differences are minimal.  What really matters is how easy it is to commit your changes.

For some perspective we go to the best thing to come out of Microsoft: Code Complete 2nd Edition by Steve McConnell:

In mature technology environments—[SVN, for our purposes]—we benefit from a rich software development infrastructure. ...The tools are well documented in vendor literature, in third-party books and articles, and in extensive Web resources. Tools are integrated, so you can do [everything] from within a single environment. If you do run into problems, you can readily find quirks of the tools described in FAQs. Many consultants and training classes are also available.
And this holds true.  SVN is integrated into Eclipse (two or three different ways, Eclipse being what it is), Komodo, TextMate, and all the other big names in software development.  Ruby on Rails developers can use Capistrano to automatically upgrade their apps using SVN.  This means that I can be working in Komodo and when I'm happy with my code I press a button and Komodo handles the process of committing my changes; no command line, no mess.  If I'm using an IDE that doesn't support SVN Visual Studio then you can use TortiseSVN on Windows to handle all your checkout/commit/change/switch/branch/tag etc. needs from the Explorer, with pretty icons to let you know the status of all your files from Windows itself.  Mac users can use Versions (in beta but pretty good) to get some of the same functionality.

Returning to Mr. McConnell for the other side of the coin:
In early-wave environments—[GIT, for our purposes]—the situation is the opposite. Few ...choices are available, and those...tend to be buggy and poorly documented. Programmers spend significant amounts of time simply trying to figure out how the language works instead of writing new code. Programmers also spend countless hours working around bugs in the language products, underlying operating system, and other tools. Programming tools in early-wave environments tend to be primitive. ...Vendors revise their compiler version often, and it seems that each new version breaks significant parts of your code. Tools aren't integrated, and so you tend to work with different tools for UI, database, reports, and business logic. The tools tend not to be very compatible, and you can expend a significant amount of effort just to keep existing functionality working against the onslaught of compiler and library releases. If you run into trouble, reference literature exists on the Web in some form, but it isn't always reliable and, if the available literature is any guide, every time you encounter a problem it seems as though you're the first one to do so.
Grim, no?  Actually not really. Living on the edge can be fun, and there is often a very good reason that the current up-and-comer is an up-and-comer.  GIT's distributed methodolgy removes the single point of vulerablility that has plagued SVN, and may well repace SVN as the de-facto standard, just as SVN replaced CVS. (This article could just as well have been about Ruby being the new PHP, just as PHP is the new Perl, just as Perl is the new Awk...and so on. But I'm not nearly crazy enough to jump into the Rails/PHP/NetBeans/Coldfusion battle.) But for now switching to GIT means that there is no Komodo integration, primative Eclipse integration, (TextMate, of course, already has an excellent GIT bundle) and users of Visual Studio and other non-integrating platforms are forced back to the command line for all their actions.   More steps means more people forget to take those steps, which means that more people lose their work to midnight "it seemed like a good idea at the time" edits and hard disk failure. 

So what do you do?  Should we always wait until something is mature to use it?  No.  New things often have very good reasons to exist, and we should learn them, even if only to keep ourselves from getting stagnant and sounding like Richard Stallman.  But if you are coming up on a deadline (like I am now) then this might not be the exact right time to try to piece together a new CMS/IDE/OS combo.

I mention this because my workplace just moved me, at long last, from a Windows XP system to an iMac, and I am doing a lot of system setup in the face of deadlines, and the wisdom of not doing exactly this is staring me in the face.

Anyway, feel free to let me know what your favorite CMS is, and thanks! (Perforce users need not apply.)

Tuesday, July 15, 2008

How I Learned to Stop Worrying And Love The Web

Okay, so here's something I've worried about: My photos. I work with computers enough to know that catastrophic hard drive failure happens, and happens regularly. Most of the stuff I have on my iMac at home isn't that critical. Yes, I have a lot of programs, but I also have my license keys stored online and I can retrieve them and re-install them at will. No big deal. And yes, I have some documents that I wouldn't want to lose, but documents are small and, once again, I have them backed up to a server online (okay, I have a .Mac Mobile Me account. Sue me.) so that's not a big problem. And even if I lose all my documents, It's once again not a big deal.
The problem is the one irreplaceable directory on my computer: the one full of those pictures we have of our kids at birth, their first camping trip, etc. No matter what I do, I can't re-create these pictures if they're lost.
So like a good Mac user I bought an external hard drive when I bought Leopard, and Presto! Instant Time Machine! Now if my computer hard drive dies, I still have all the pictures. I'm safe!
But... What about, say, a fire? Or a thief that spends the time digging my Time Machine disk out of the place I hid it? Or a really odd power surge? Or rabid hard-drive eating weasels?

So once again I had a problem that was keeping me awake at nights. Not for long, mind you, just a few seconds; just a small bit of psychic baggage on my soul. I considered buying a bunch of DVDs to make periodic backups, but that gets expensive in a hurry, because if you want to be sure your data is safe you need to use DVD+R, not DVD+RW.

Then I thought about getting a second external hard drive, doing monthly backups to that, then putting it in a safe place offsite somewhere, but that's a huge pain in the backside, so I probably wouldn't do it very religiously. Also, what if your house burns down when you have the offsite backup hard drive in the house? Now you're hosed again, so you should get a second offsite backup hard drive, and only have one backup hard drive in the house at a time. This road has no end, folks. I read a book by a gentleman who had seven hard drives to which he did backups, rotated into and out of his home, so he always had a backup or four offsite.

The observant among you will remember that I said I have a .Mac Mobile Me account. I also have around 20GB of pictures, and I don't know how much longer I want to pay Apple's prices for storage.

So, to recap: I have my almost-but-not-quite safe pictures on my hard drive and my Time Machine disk, and all of them up to two months ago on DVD's that are at my wife's mother's house.

And then I discovered Amazon's S3 service. (S3=Simple Storage Service) Put simply, Amazon will let you store stuff on their servers for a certain amount. Specifically, $.15/GB/month. So for my 20GB of pictures, I would pay $3 a month, or $36/year. Transfers in and out are ludicrously cheap as well, so to upload all my pictures at $.10/GB is $2.00 (Requests are $.17/GB for the first 10TB, less thereafter).  With this service, Amazon worries about having enough redundancy, getting larger hard drives as needed, etc. etc. etc. and all I worry about is sending my my $2 every month.  ( Or else they send out a creepy kid on a bike to hunt you down, man!)

So great, but I still needed a way to make sure I have my most current pictures stored at all times. Mind you, apps like Transmit (which I love) give you access to S3, but they aren't good auto-backup programs.

Enter JungleDisk. For $20 you get lifetime upgrades, and they provide a frontend that will do automatic scheduled backups to Amazon's S3, as well as allow you to mount your S3 "buckets" as a network disk. JungleDisk also encrypts all data that it stores, meaning that even if someone gets into your S3 account, if they don't use your JungleDisk username and password they can't access your files. They've created the application for all major platforms (Win/Mac/Lin), and provide a USB version that includes all three versions, so you can access your data from any computer with USB.
So, the price of peace of mind:

Second External Hard Drive:
$99 for a 500GB LaCie (or possibly $198 for two external drives)
Travel time+Gas: ~$25/year
Safe deposit box:~$50/year
Total: ~$273

Or:
 

S3
Storage: ~$36/year
Transfer:$2
JungleDisk: $20
Total: ~$58

Kinda seemed like a no-brainer.

One caveat: I have a slow (1.5Mb) DSL connection; so the initial transfer has taken (so far) 4 days, with probably one more day remaining.  Mind you, this is five days during which my wife and I have been using this computer just as we always do, web browsing/email/downloads and all. Thank goodness for a stable OS, but still, be aware.

Sunday, July 13, 2008

One Year of Carrying Coals

Wow. One year old today. That's kinda cool. It's been fun for me. I hope it's worth it to you to keep my little blog in your feed reader. Thanks for coming along for the ride!
In that one year (according to all my stat aggregates) I have been visited by a surprising number of people from India(Shukriya), Indonesia(Gum xia), Canada(Thanks), Norway(Tusen takk), The UK(cheers), Germany (Danke schön), and of course, the USA(hey, thanks). Most of this is coming from searches, which is a huge turnaround because originally most of my traffic was people I told to "go visit my site. Please?"
Interestingly, more than three times as many visitors to Coals[2]Newcastle use Firefox as Internet Explorer.  My most popular posts are things about Eclipse in general and Zend Studio for Eclipse in particular.

Once again, thank you all for visiting. There's still a bunch to see.

Saturday, July 12, 2008

"Vista Bullying" on Crazy Apple News

I try not to do this, but I've already said everything about this subject I could think of, so I'm just redirecting you to read my comments about Microsoft's "The Vista Bullying Stops Here" speech on crazyapplenews.com, my other blog.  As the name implies, it's a much more focused and much less factual blog than this little thing, but this particular article works, I think.

Anyway, enjoy!
(http://crazyapplenews.com/2008/07/vista-bullies/)