Source control and me - Why I use git and github

December 29, 2009 | categories: Pcs, Programming

The biggest change to programming for me this year (apart from spreading out from just PHP and Javascript) is that I now use source control for most of my projects. I started out on subversion because it was widespread, easy to use (with TortoiseSVN, I was still a Windows "everything must be GUI" user at the time), and there was a handy tutorial for it published for it on a blog I happened to read. I used that for a good while until a friend showed me git and github. I'd used Sourceforge and Google Code for a while, because although my projects are too small for anyone else to be interested in adding to them, the benefits of having a remote source control service that's always accessible from any computer are huge for me. And it's handy for showing people the program in more detail if I need help on Stack Overflow.

While I was (and still remain) unconvinced about the benefits of distributed source control versus normal source control, and more specifically of git vs svn, the benefits of github versus google code (which I had been using at the time) were more than enough to convince me to make the switch. It also helped that at the time, Linux had recently become my main OS with Windows being relegated to usage for syncing my iPod Touch and gaming, and I had become much more familiar with CLI usage of the system, so the command line orientation was no longer the problem it once was.

Branch history of a small github project

Look at the pretty graphs! (ignore Chromium for Linux's fail at positioning. My cursor is actually on that big green dot on my screen. It's just the screenshot gone wrong. This is the fault of

Setting up git and github was simple. I could give you instructions on how to do it, but Sirupsen has already done this much better than I could for Linux users. For Windows, there is another tutorial hosted on github,

Usage of git with my github account is equally simple.

  • Change files
  • git commit -a
  • Type commit message into nano (or vim if you've changed your system editor, or notepad if you're on Windows)
  • git push origin master

The only thing I missed during switching was that Subversion numbers revisions like 1, 2, 3...20000 while git uses md5 hashes. But I can live with that.

Programming: Simple Python Todo List manager

December 28, 2009 | categories: Programming, The Playground

My latest programming project is a todo list manager written in Python.


  • Add, Remove and show items
  • Manage multiple lists
  • Lists are stored in JSON

It also has a GUI, but that needs a lot of work. As always, the source code is available on my github. Unusually for my projects, it is already fully functional (though as I said, the GUI needs a little work).

The Playground

December 12, 2009 | categories: Programming, The Playground

Over the last 2 years, I've done a lot of personal programming projects. Some of these are available on my github, but any information about them is spread among Twitter and a few forums (some of which no longer exist). So over the next month, I'm going to blog about a few of these. I've chosen the name "The Playground" for the category because it accurately reflects both the nature of the projects (small projects that are mostly tinkered with, with very little concrete plans) and the reasons for making them (to practice programming, or to mess about, or because I was bored).

Anyway, for the time being, here is a quick summary of my projects currently in my github repo:

Twitter Matter

This is a simple Python program to send tweets from the command line. At the moment, it can send tweets, and get the latest tweets from your timeline, your friend's timeline, and @replies to you. I made it mainly because although I've always said Python looks like a nice language, and I know the basics of it, I never wrote an actual program in it beyond Project Euler maths puzzles.

JavascriptCity (aka Webcity, webicity, JSC)

This is an attempt to write a Simcity clone in Javascript. I got quite far into it, with the ability to set zones, have them develop and build roads actually working. However, at the current stage any change I make is too bad for performance that it is basically on hold. I can say it's definitely not impossible to write a Simcity clone in Javascript, but you need someone with better Javascript skills than me to make it, and probably someone who knows about <canvas>.

Young Developer Forum

This is a program set up by me and a Iroup of people on a forum which has since shut down. It didn't really get very far.


This is an IM server and client that I wrote in Java. It was my first experiment in GUI programming and Threading in Java. Some revisions of it work, and some don't.

JS Battleship

This is a battleship game I am writing in Javascript. It re-uses a lot of code from JavascriptCity, but without the huge 200x200 table grid that caused a lot of programs.

Learning C++

August 26, 2009 | categories: Programming

As usual, I'm falling behind on blogging. One of the reasons for that is I am currently learning C++.

A while back, I had a brief exploration into C++, and learnt the basic syntax, then moved on and didn't do anything related to it for 6 months. The majority of my programming has been done in Javascript, Java or PHP, though I have looked into other languages. Since Java and C++ are quite similar in some respects, and I did learn the basics beforehand, I'm not starting from scratch completely, though in some ways it would be beneficial if I was. An example is this:

int array[somevar]

Perfectly legal, and quite common in Java. In C++, this shouldn't work. Except it did for me, because it is a g++ extension. Someone with no programming experience would not have tried this. This is something I hadn't expected. I had expected C++ to be more like Java, and PHP where there was one standard of the language (and the only differences were between new and old), but it seems, like Javascript, there are a few variations per implementation.

Another thing that surprised me was the small size of the standard library. Compared to the Java API, and the .NET Framework, the C++ Standard Library is tiny. No GUI code, no threads, no networking functions.

The final hurdle I encountered is there is so little information about C++ online. On the one hand, I should of expected this, as the origins of C++ predate the internet, and it's not a web language, but it means I have a lot of difficulty finding material. My local book store has only 3 shelves of computer books, with the programming catalogue nearly entirely taken up by C#, Java and PHP. As well as that, the books I found in the library are quite old and mostly aimed at people coming from C or Pascal, or a variety of other older languages.

I'm wondering what other people's experience of learning C++ is.

First serious Java programming project

July 27, 2009 | categories: Programming

I've done a good bit of programming in PHP and Javascript, but up until recently, my desktop programming experience has been limted to calculators and other similar simple programs. However, that is changing as my current programming project is an IM client and server written in Java. The name is Machat (hey, I'm not very inventive) and the source code is under the GPL and available at my new github account.

Currently it is in a VERY rough state (in fact it doesn't even send messages) and I don't really expect it ever to be succesful, but it's still an interesting project to learn about GUIs, threading and network programming (3 things you don't do a lot of in PHP).

« Previous Page