Software Development

Mercurial - Distributed RCS

I’ve always used Subversion as my choice of RCS (Revision Control System), but the hassle of setting up a repository for each project just was a bit too much. That, and the fact I often had to re-read the quick start pretty much every time I went to use it meant that it really wasn’t a solution I regularly used. It basically came down to the idea that if something isn’t easy to use, it probably won’t get used.
Now Subversion is certainly good, but I really need something lighter…and then I started reading about distributed RCS’s which was my introduction to Mercurial.

I couldn’t be bothered describing all the fundamental differences that are documented everywhere else in comparisons between distributed and centralised RCS models. Here are the benefits that I’ve found though:

  • No need to have a separate repository/folder to the actual project. That is the working directory/repository exists with the project, something that makes file organisation much easier.
  • Mercurial commands just seem easier. With Subversion, I always struggled with creating new repositories. Not so with Mercurial.
  • Mercurial is written in Python, a language I really enjoy writing in, so, good potential for future hacking if necessary.
  • Mercurial can easily be installed locally as a user.

Creating a Repository

Whilst in the source folder

hg init # Create the repository.
hg add # Add the files in the folder into the repository.
hg commit # Commit the changes.

That’s it.

Cross-Platform Development

For those who don't know, Qt 4 is offered in two(+) variations. A GPL'd version that requires you release the final application under the GPL as well and a paid development kit that lets you do whatever you like. Part of the license requires that if you use the free tools anywhere in the development process then you need to release GPL'd. So you can't use the free tools and then use the paid-for version in the final release. Since the paid-for version is definitely not cheap, unless you can be certain you're releasing under the GPL, then Qt becomes a difficult choice.

Okay, I think I've found it. I've been looking for a cross-platform development solution for a while now and I used to use Qt, although I never actually got around to building it on anything other the Linux. But now that I've started working full-time, I needed to find something where I didn't have to worry about the licensing.

My first instinct was Java, as I wanted something with a fairly quick turnaround. But I just didn't like how it looked on Linux and I basically got confused with all the talk of AWT or Swing or whatever the current flavour is.

So, I turned to wxWidgets, a cross-platform library that I had looked at years ago, but never really liked. However, I really wanted a faster application turn-around time than C can provide as what I'm building are really just small utilities and so I added Python into the mix and started learning both a toolkit and a language at once wxPython.

The first tool, a PLC code generator, is coming along nicely and has had a quite quick development cycle. Especially since I am learning both a language and tool-kit in one hit. My final evaluation is that wxPython is truly a powerful tool and my only disappointment is the difficulty I'm experiencing in finding really good documentation with example code. If anyone can point me in the right direction, it would be much appreciated.

Automated Source Code Processing

There's a tool called PMD that lets you do all sorts of nifty things to java code, looking for possible bugs, dead code, suboptimal code and overcomplicated expressions. Unfortunately (or fortunately), I don't code in Java, but there is an additional tool in the set, CPD which let's you find duplicate code sections.

Duplicate code sections are bad, because if you copy and paste something, and there's a bug, then you've copied the bug which might get missed in a bugfix. But all seasoned coders know such things. I always remember the phrase "Code duplication is an error.", and sometimes I even pay attention to it ;-).

The good thing about CPD is it works with C, C++, Java, JSP and PHP, so it should be a worthy tool to add to a programmers collection.

Syndicate content