Holidays and Higher Standards

In the last few weeks, Jeff Atwood has posted a few articles about common problems in code. The one that grabbed my attention was about ASCII vs. Alphabetical sorting. I couldn't agreee more with the post. However, I think it's slightly unfair that the programmer cops the flack for these issues.

I know, that sounds odd. We write the code, why shouldn't we be responsible for it? Personally, I think that a lot of poor quality code is written in places where there is no higher standard. Managers accept code that achieves 90% of the initial specification, and thus bad code is born.

Programmers need to have a bit more pride in their work! Why can't we peer review other's code, even if it's not in a formal manner. What's wrong with striving to better your coding skills? Employers can help too - find the programmers who are serious about their work and offer to send them on a usability course. You will be rewarded with cleaner user interfaces, and happier programmers. Promote programmers who write good code - let THEM shape the programming culture in your business, not the programmers who have been there the longest.

On that note, I leave you, dear reader. I'm on holiday for three weeks in New Zealand. I'll try and take some photos and upload them when I get a chance.

Till we meet again!

General update

After spending four days in France, I have a newfound respect for anyone who lives or works in a country where their language is not spoken. The French are certainly not the most forgiving when it comes to people who don't speak their language.

In other news, I'm starting a new project to build a better build script for my work's source tree. It's kind of like scons, but much much simpler. Should be interesting to see what it's like when it's finished.

I'm still thinking about ideaforge... I really think it needs to be done. I wonder who can provide some insight on the issue...

Turning ideas into applications

If you're anything like me you'll frequently come up with ideas for neat applications. For me, turning those ideas into code is the challenge. It's not that I'm incapable of writing code - I have more than enough experience to write simple applications. The problem is that I lack the enthusiasm and energy to complete my projects.

Looking back over the projects I have completed, I notice a pattern. In order for me to complete a project, one of two criteria must be present:

  • I need to be paid. Money is a great incentive. Think this is shalow? you're probably right.
  • I need to be working with other, like minded individuals. There's nothing more rewarding than working with a bunch of intelligent people who are as excited about the product as I am.
For commercial projects, the former requirement is enough to get me to do my work. For open source projects however that is a luxury don't have.

So, getting back to the original problem - how do I turn a half baked idea for an application into an open source project with 2+ developers? Traditionally the process has been something like this:

  1. Have brilliant mind-blowing Earth-shattering revolutionary idea.
  2. Start writing code.
  3. When code gets slightly usable, create a sourceforge project and advertise project page like crazy.
  4. Hope that some like minded developer notices it and wants to join in.

There are several problems with this approach. First, sourceforge is littered with projects that have 0% activity. These ghost projects have long since been abandoned by all the developers (I swear they're not all mine!).
Second, you only have a chance of attracting new developers to your project after you've written a good chunk of the code. This forces new developers to learn the code that has already been written, and prevents them from offering any input as to programming style, programming language, libraries, code organization, feature list development strategies etc. etc. Personally, I think that one of the best parts of working on an open source project is having the opportunity to makes these kinds of decisions.

It seems to me that what we need is an ideas forge. Imagine a place like sourceforge, but for ideas. There would be facilities for advertising ideas, giving feedback on existing ideas, hosting design documents, holding discussions etc.

Unfortunately, ideaforge is an... idea.. Now all I need are some talented programmers to help me create it....

KDE 3.X: The good, the bad...

I Love KDE. With the final KDE4 release just around the corner, I thought it'd be good to note down some of the best and worst features in the 3.X series.

Why KDE?

I use KDE exclusively on all my Linux boxes. Why? It just... feels better. I've tried several alternatives - XFCE (which I like very much, but it lacks some of the features I need), WindowMaker, Fluxbox (great on a low-end PC), Enlightenment (supposedly the nicest looking window manager for Linux), and Gnome. Gnome is, of course the main competitor for number of users. It's the default window manager for the Ubuntu project.

With so many other choices, why choose KDE? There are two main reasons:

  1. It is incredibly configurable. There are so many options I could spend a whole day setting up a new install. Some people say that this is a bad thing, and it certainly is for a novice user. Who wants to be bombarded with configuration screens? However, I consider myself a power user and enjoy the added flexibility.
  2. KDE features brilliant integration between it's apps. Thanks to the KPart technology (Think OLE done right for Linux), it's very easy (from a programming perspective) to embed one application ( or "KPart" inside another.

The Good:

As far as I'm concerned, the best featured of the KDE 3.x series are (in no particular order):

  • Window Management. I personally Love the "Keep Above Others" option - it allows you to keep a window above all other windows on your desktop. Some windows applications can do this, but I've found that they don't play nice with the Alt-Tab task switching when they do.

    In KDE, this feature is part of the window manager. Application programmers get it for free! You can also do the reverse ("Keep Below Others"), or enable full screen mode (no prizes for guessing what that does!).
    Another useful feature is te ability to customize the behaivour of any window - either just once, or every time that window is created. For example, I may want my IRC chat client to always start at a specific place on the screen, have it stuck to the bottom of the window stack, and disable thew window decorations. With KDE, this is all taken care of by the window manager. Neat huh? but we're just getting started...
  • Kate is a brilliant text editor for KDE. I use it for all my programming (well, sometimes I'll revert back to vim). Out of the box it supports syntax highlighting for hundreds of languages, code folding, and a whole lot more. you can download plugins to extend the editor too. One of the main reasons I use it above other text editors is the built in Konsole (thanks to KPart). This is so increadibly useful i can't imagine life without it.
  • Other KDE applications that I use every day and love include Konversation (IRC client), Konsole (guess), and Amarok (best music player you ever did see!)
I'm aware that other window managers may have similar features, especially the larger ones, like Gnome.

The Bad:

Nothing is perfect, and KDE is no exception. Here are a few of the things that I don't like about KDE.

  • Konqueror. Konqueror is KDEs default web browser, file manager, and a whole lot more. My main gripe is that it's trying to do too much at once. When you think about it, browsing the web and browsing your hard disk are two very different tasks. Konqueror tries to achieve this balancing act by working in "modes". Sometimes it looks like a web browser, and some times it looks like a traditional split-pane disk browser.

    The web browsing features are okay (I especially like the fact that typing "gg: foo" in the address bar searches google for the word "foo"), but why try and compete with Mozilla firefox? The first thing I do on a new KDE installation is install firefox and remove all the konqueror shortcuts. Firefox is already well known amongst computer users. Why not put more energy into integrating firefox with KDE?

    The disk browsing side of konqueror is rather tragic. My main gripe is that by default, clicking on something opens it. A single click! Users migrating from windows will find this very confusing. If you just want to select something you have to hold down the Ctrl button.

    It seems that in KDE4 the disk browser part of konqueror is being split out into a separate app called Dolphin. I can't wait! Now if we could just ditch the rest of it...
  • Lack of Xinerama support. I run a dual (and sometimes triple) head setup at home. KDE has very limited support for Xinerama. For example, I'd like a window decoration button that lets be move an application to the next / last / other screen, even if it's maximised. Ultramon for windows gives me this, and it's very handy. Several applications will always display their "fullscreen" mode on the first display only, which is a real pain (especially since my first screen is my laptop).
  • The K menu needs a lot of work. Mine tends to get cluttered very easily. It'd be nice to have some easy way to organise applications into frequently used groups.

All in all, I'm not complaining. If I had more time I'd try and improve KDE myself, but I'm rushed off my feet as it is!

Book Review: Begining Game Development with Python and Pygame

I love Python. I Love Pygame, and I love programming. What could be better than a book that combines all three?

These were the excited thoughts that were racing though my brain as I was looking for a suitable money sink on amazon. The book's subtitle is "From Novice to professional", and I wasn't expecting much. You see I have a tendency to buy books that I don't really need. I already know a fair amount about programming with Python, and I've used the Pygame library on numerous occaisons. So why buy the book? I was hoping that the book would stimulate me to finish one of the hundreds of half-completed game projects on my hard disk.

The book has 12 chapters in total. The first three are a gentle introduction to the python programming language and the pyGame module. The next four chapters are the meat of the pyGame related matter. Most of the pygame modules are covered here. Finally, there are four chapters covering 3D aspects and OpenGL.

As you may already have guessed, I'm not overly impressed with this book. My main gripe is that the content doesn't reflect the book title. For example, Apress (the publisher) have included a little diagram on the back of the book (I appologise for the poor image quality):

To me this indicates that the book in question assumes a working knowledge of python. Why then the four chapters introducing the programming language? Similarly, the last four chapters of the book are about OpenGL and 3D game programming, which bear very little relevance to PyGame, which is primarily concerned with 2D applications. The books chapters also seem a little jumbled together. For example, there is a chapter on playing sounds in the middle of the 3D chapters... where did that come from?

The chapters that were on topic were pretty mundane - the reader might have just browsed through the superb PyGame documentation.

Overall, this book probably isn't worth buying if you want to learn how to use Pygame, just read the online documentation. If you want to learn Python or OpenGL, there are better books out there. This is a book with great potential. If the author had stuck to the subject matter this book would have been a lot better. A few constructive criticisms then:

  1. Lose the Python into and the OpenGL stuff. People will buy this book because it has the word "PyGame" in it. We don't care about OpenGL, and we already know how to program in python!
  2. Make the example a little more meaty. At the moment almost all the examples demonstrate simple pieces of the pygame library. Some examples that demonstrate how these pieces are put together to form a playable game would be nice!
I did actually enjoy reading the book, it wasn't a complete waste of money. I'd give it 5/10. It was enjoyable to read, and did contain some useful information, even if that information was present in a better form on the web.

Now, If I could only get around to finishing that game.....

Filthy Lucre in the United Kingdom

As I sat on a train in Waterloo train station today I noticed that two large credit card companies were touting the end of cash as we know it. The first is the mastercard "CASH" billboards (sorry, I couldn't find a photo online). The second is VISAs "paywave" system.

I would like to take this opportunity to point out to both credit card companies that cash is not dead. The main reason is that card machines are still not universal. I come from a country where every store, no matter how small accepts bank cards. In the UK however, it seems that only larger stores bother with electronic bank cards. I suspect that the banks are behind this.

Let's not introduce yet another form of payment before we've made the current forms universally available! Drop bank charges for companies wanting to accept credit cards (after all, it must result in fewer bank tellers handling cash, which can only be a good thing, right?), and lets make electronic purchasing

Programming without Requirements?

I had the opportunity to catch up with some old college friends of mine recently. We all graduated together, and we're all working as programmers in a variety of industries around the world. I work in broadcast automation, another friend works in publishing, another in engineering.

Eventually we began talking about our jobs. What struck me was that none of us are happy with the way our programming is being directed. Let me be a little more clear...

In college we were all taught that requirements determination is a fundamental step in producing quality software. This makes sense - after all, how can you write good software if you don't know what it needs to do before you start writing it?

Unfortunately, none of my friends feel that requirements determination is given the focus it deserves. It is, of course entirely possible that we were unlucky; three is a very small sample size to make sweeping generalizations about the entire programming community. However, I'm going to do just that!

All three of us had been in a situation where we were being asked to program something without having a very good idea of what the required outcome was. As it turns out, I am in this situation right now (Actually, I'm writing this blog entry as a venting mechanism so I can sleep tonight). I'm being asked to write a plug-in module that will take me at least a month of solid programming. What does it do? I wish I knew!

Don't get me wrong - I have a rough idea of what it needs to do. However, I have no formal requirements, no use cases, no user stories, no access to the target environment or system, no protocol document, and no access to anyone who knows any more than I do. Frustrating? you bet.

I understand that in a project-driven environment sometimes some of the requirements may change - I accept that. However, I really think that there needs to be more attention paid to the period of time before any code is written, so that hopefully programmers can spend less time writing code, less time fixing code that was poorly written, and more time drinking beer!

If anyone has similar stories, or can tell me that I'm being naive, I'd love to hear them (for the record, I don't think that naivety is such a bad thing - sometimes it takes a little innocence to spark changes for the better).

*buntu rant

I've noticed several negative news stories regarding the latest (7.10) release of the Ubuntu Linux distribution from Canonical. I feel I owe it to the good people working on this fine operating system to defend them on a few points.

First, I want to comment about stories such as this one that complain about the bugs found in Ubuntu after it's release. The article talks about the broken IPv6 / DHCP implementation. To start with, the article seems like it was written on a whim after a single reader wrote in to complain. I quote:

Our reader told us that Gutsy Gibbon's internet access "whether by wireless; ethernet or USB DSL modem is either impossible without some deft work at the CLI [Command Line Interface] or is incredibly slow (mostly from delay in resolving DNS)".

Hmmm... Perhaps in the future they should stick to reporting only what they have personally researched? And the poor journalism doesn't stop there - they then use a quote from Willie Faler's blog completely out of context; to quote the article again:

While blogger Wille Faler, who pointed out that many routers do not support IPv6, has offered a possible "work-around" for a problem he described as being a "big flaw in Linux's handling of DNS-servers".

However, if you actually read the article on his blog, you'll see that he wrote

Ok, I’ll be the first one to admit that my dismissal of Ubuntu as, shall we say “not too good” was a bit premature. I eventually found the cause and fix to my network problem. It is not a fix for what I consider a big flaw in Linux’s handling of DNS-servers, but it is a workaround that should be sufficient for most people, including those that spend considerable time on the go, like me.

What on earth is happening at The Register?

Anyway, regarding the actual release... I have a deep sympathy for anyone working on the Ubuntu project, volunteer or otherwise. I write code for a largish sized application suite, and I know how hard it is to test every possible permutation of software combinations - I can't imagine how hard it must be to test an operating system for a wide variety of hardware. I suggest that the author of the offending article spend a few months fixing bugs for any large software project; perhaps he will gain a better understanding for the issue.

I would like to take this opportunity to remind people that Ubuntu relies, to a certain extent on community support. I encourage anyone who wants to help out to download the beta releases and release candidates and report these bugs as soon as they appear. That way, we can hopefully reduce the number of such incidents along the way.

Incidentally, I stumbled upon this blog entry by Matt Loney - he expresses my thoughts on the Microsoft Vista operating system better than I ever could. He writes:

Why did Microsoft ignore the first rule of usability and ditch all familiar methods of doing stuff that I'd spent 15 years getting used to?

I couldn't agree more! Further, in the XP to Vista upgrade Microsoft deprecated many of it's APIs; this creates a whole lot of work for application authors. I understand that APIs need to be updated as the technology improves, but many of the libraries that were removed were still functioning and widely used. Why remove them? The cynic in me suggests that there must be a monetary motive at play here..

But I digress; this post was supposed to be about Ubuntu! If you haven't tried it already, download the new 7.10 release of one of the Ubuntu projects!

A new beginning

Well, this is the first post for the new-and-improved tech-foo blog. I used to maintain a blog-like website on my own web server back home, but the hard disk crashed and burned. For a long time I couldn't be bothered keeping a blog, but this post from Coding Horror convinced me otherwise. Hell - even if no one reads this it'll help me offload after work. If this blog seems more like a therapy session than an actual tech blog you know why!

Hopefully I'll have the mental discipline to keep this blog going. So many of my friends cite lack of spare time as the main reason why their blogs died. Personally I think that's a bit of a weak excuse. Please remind me of that when I stop updating this blog.

Anyway, welcome to the blog, please feel free to leave your mark in the comments section!