Git-R-Done
I’ve been a long-time fan of using Subversion for source code version control, but recently I’ve been turned onto using Git, which is the version control system used by huge projects like the Linux Kernel, Ruby on Rails, Merb, Samba, VLC, and a lot more. It was designed by Linus Torvalds so it really has some geek street cred.
Why is it so cool? Git is distributed, for one thing. That means that while you may have a central location for your repository, each client clones the repository on their system. So if you lose a machine you don’t lose all your history for the project.
Being distributed like that makes it fast, because looking up history is done locally instead of over the network, so you gain a lot of performance. It has been shown to be very fast and scalable by a significant amount.
Branching, tagging, and merging are a lot easier in Git because they are treated as core concepts. Every working directory of a Git repository is in itself a branch. Handling those branches is something Git excels at and keeps track of merging the changes from different branches with ease, preserving the history of who did what a lot better than subversion does.
You can see more comparisons and contrasts between Git and Subversion on the Git Wiki.
Another (personal) reason I like Git is because of a certain tool: Github. Github is a repository host that acts almost like a social network: you can track projects you are interested in to see the latest activity as well as giving you the ability to maintain your own projects. It is a sweet little setup. If you are into development at all you might take a look.
I have decided to move my Guilder project to Github, and so far I love it. My endorsements, they are ringing!
Includes and dependencies in Javascript
For a while now I have been wrestling with a way to easily manage dependencies in Javascript.I absolutely hate having a mess of script tags in my documents, especially on a dynamic page that only uses maybe one or two of those scripts.
So when I started using jQuery, I was delighted to find that I could write an easy method to include files on the fly using Ajax and synchronous loading and execution of Javascript files. This gives us the ability to utilize lazy-loading to load scripts as they are needed and not clutter up things or waste resources if a particular Javascript is not needed.
It is easy to define a method like this (utilizing a class so as not to pollute the main Javascript namespace):
SLAGGLE = function() {};
SLAGGLE.include = function(filename) {
$.ajaxSetup( { async: false } );
$.getScript(filename);
$.ajaxSetup( { async: true });
};
This uses jQuery’s getScript method to load a script, but first sets global Ajax configurations to load it synchronously so we can use it right away. So now if I want to load a script on the fly, I can do so with this:
SLAGGLE.include('/path/to/js/script.js');
You can even go a lot further and create a method to translate a package heirarchy like what Java uses into a path structure and load that instead.
I’ve been using this method for a while, but this morning I stumbled across this: using.js
using.js gives stronger dependency management to Javascript by allowing you to declare potential dependencies beforehand, and load them on the fly. The upside to doing this is that not only do you get lazy-loading, but the using.js script will only load a particular dependency only once, which cuts down on overhead quite a bit. It’s real easy to use, too. Just register your dependency like this:
using.register("jquery", "/path/to/jquery-1.2.3.js");
or even multiple dependencies:
using.register("yui-datatable",
"/path/to/yui/script1.js",
"/path/to/yui/script2.js"
);
Then later, when you need to make use of the dependency, you can do the following:
using("jquery");
// Use jQuery features
$("document").ready(function() {});
using("yui-datatable");
// Use YUI features, etc...
The using.js script really adds a lot of power to your Javascript coding. It has the potential to make your code much more efficient if you rely on a large number of external dependencies. Give it a try and let me know what you think!
Introducing Guilder
I’m announcing a fun part-time project I am starting called Guilder: The World of Warcraft Guild Management System. The project has just started so there isn’t any code yet, but it is a serious effort I am undertaking to both solve some problems of guild management and to learn more and more about Ruby on Rails.
Yes, the code will be Ruby on Rails. Why not Grails like I have been fond of? Well, mainly personal reasons. After spending time with both platforms, I really feel like the best fit for the web is Rails. Grails is quite derivative and doesn’t have as large a community behind it, plus personally I feel it has more elegance to it. So back to Rails I come, and find a familiar friend with open arms.
Guilder will be licensed under the MIT License, an OSI-approved open source license. Why did I choose the MIT license over something like the GNU GPL? The MIT license is very flexible and not as restrictive as some of the other open source licenses out there. I can link my code to commercial libraries, people can fork the code and sell it, and basically do whatever. I dig that type of openness.
Progress will probably be slow on this because like I said it is a part-time endeavor, but it is there and I will be working on it. If you are interested in helping, let me know.
Other ideas for web applications
I’m tossing around more ideas for web applications, just to see if there is anything I can really latch onto as a project to hone my ruby skills. One idea that came up arises from a need my World of Warcraft guild has for guild management. It would be awesome to be able to manage and maintain the following items in one application:
- An updated roster, periodically synced from Blizzard’s Armory website
- A forum for communication
- A calendar for scheduling raids
- An application with ability to manage what classes are needed for recruitment
- Integration with WowJutsu for guild rankings
- Integration with Wowhead for item links
- Server status polling
That’s just a few use cases that I can think of off the top of my head, and really the list could be expanded upon to make it attractive to guilds/clans for a variety of games. Right now people have to spend money on services to provide this sort of thing for them, having an open source guild management system they can put on whatever webhost they want (as long as it supports Rails) would be awesome. I might consider this and start hacking away on it.
Twitter Updates for 2008-04-04
- Gotta love all-morning meetings. #
- So yeah. Meetings seem to rule my world now. I wish I could turn that statement into something more interesting, but it is a fact. #
- Maybe instead of complaining about work on Twitter, I should make stuff up. Yarr! I just dueled a honest-to god pirate! He stole my booty. #
- @hornbeck Grats on the new frames. Share some pics, man! #
Twitter Updates for 2008-04-03
- Have a great Good People Day, everyone! And thanks to @garyvee for starting it up! We need to be good people every once and a while.
# - For help with Good People Day and beyond: http://www.acomplaintfreeworld.org/ #
- I’m off to the gym to de-stress like a mofo. #
- I’m very close to just going home and calling today a wash due to building annoyances. Maybe it means something good is coming? Who knows. #
- jQuery is by far the coolest Javascript framework I’ve worked with. It is making my development soooo much easier. #
Twitter Updates for 2008-04-02
- Tonight we rolled level 1s, created a new guild, and downed Hogger as a 20-man raid! Then we went to the gates of Karazhan! Fun evening! #
- Up awake blocking and googling a prank caller. Ugh. #
- I am incredibly tired today. I didn’t get much sleep at all last night, and so now I’m going to be useless today. Maybe coffee will help. #
- The day keeps getting worse! I was looking forward to eating a sliced cucumber with lunch, but it was sour and slimey. Nooooeeesss! #
- @JasonCalacanis My vote is for Merlon to host Mahalo Daily! hehehe #
- Yay! Got the YUI DataTables to work with context menus and my custom json data elements for work. The day might just turn around yet. #
- Imogen Heap, why are you in my head?! Get out now! Leave! The power of Christ compels you! #
- Don’t get me wrong… I don’t hate Imogen Heap. It’s just that Hide & Seek gets stuck in my head for weeks at a time it seems. Ugh. #
Twitter Updates for 2008-04-01
- Heading to bed after creating a Druid on a new realm in World of Warcraft. Time to branch out a bit! #
- I absolutely love April Fool’s Day! #
- Thanks to the RoR mailing list, here’s another Rails knockoff: Cobol on Cogs http://www.coboloncogs.org #
- I can’t count the number of times I’ve been rickrolled today. But I give as good as I get. #
- Quick! Someone mashup the Tunak Tunak Tun video with "Never Gonna Give You Up"! #
Giving up on dynamic languages
Faithful readers, the time has come for me to give up on dynamic languages all together. Utility, speed, innovation all leads to maintenance headaches down the road so it is time for me to pick up something tried and true. I talked with a good friend of mine, a Dr. Sloof Lirpa, head of the CS department at the University of Oklahoma, and he suggested something that blew my mind.
Yes, I am going to program solely in COBOL.
COBOL has been around for ages and has been time-tested in the enterprise. That’s what is important, right? Why change when COBOL worked just fine in business for our fathers?
But I can’t forget years of innovation that has happened since the advent of COBOL in the business. So to bring a bit of modern innovation to the world of COBOL, I found a great framework for developing applications: COBOL on Cogs. This will be a great way to develop code and make it enterprisey enough to land the Big Bucks!
Who is with me in this venture?

