Rant-driven Development

Python TDDers: Can we please, as a group, stop doing this:

class MyFunctionTestCase(TestCase):
    """Tests for MyFunction."""

    def test_does_thing_correctly(self):
        # given
        <setup code>

        # when
        <do some stuff>

        # then
        <assert some stuff>

Pretty please? It violates what I'm going to call Binns's First Principle of TDD, which is:

Do not make …

Useful Enums for Django

I published my first package to PyPI today. Which is odd, considering that I've been developing stuff in Python for over a decade.

I decided, after doing a bunch of work on various projects, that I needed to scratch a particular Django-related, itch. Namely, that of choices:

MY_CHOICES = (
    (0, "My …

Do Not Feed the Pelicans

I've not used this blog for a while, but I keep needing somewhere to dump dev / tech / Python / whatever stuff that's floating around in my heads so that I can see it properly, and that's exactly why I set this blog up in the first place.

Since I'm not so …

Pythonic Confessions

So, I have a confession to make.

Many years ago, I had an job interview with Canonical. This was, I think, my second interview. The first had gone well, and the second had been postponed because the original interviewer scheduled to talk to me kept forgetting.

Luckily, I got a …

sdroW tsegnoL

After yesterday's bit of fun with Python and the English dictionary, the thought suddenly popped into my head:

There are eight six letter words in English whose letters are in alphabetical order. But what about reverse alphabetical order?

Luckily, the change was a simple one. If you pass --reverse to …

Longest words

Andy Nyman tweeted the following today:

Today's Fact: The word 'almost' is the longest in the English language with all the letters in alphabetical order.

— Andy Nyman (@andynyman) December 27, 2015

And because I'm an ornery sort, I wrote a script to prove it. Turns out that "almost" is …

Transactions in MAAS

via

Gavin is at it again, talking about transactions in MAAS, and how Django makes your life harder when it comes to transactions.

Introduction to blocking and non-blocking code in MAAS

via

My friend and erstwhile colleague Gavin Panella has posted an article on how we handle(d) blocking and non-blocking code in MAAS, whilst playing within Django’s sandbox. It’s well worth a read if you’re finding yourself having to asynchronous work within a framework that doesn’t …

Inside the Sausage Factory

Yesterday, I saw a question over on Ask MetaFilter entited "How is the software sausage made?" and asking about different folks' software development methodologies and processes. I decided to share the way that things were done at Canonical, because that's where I learnt a lot of development best-practices (which I …

The Ready-to-Code Checklist

I’m currently working on a Thing for a Client, and I’m reminded of the rules that we used to have for doing Launchpad development. One of them was the Ready-to-Code checklist. Googling “Ready to Code” brought this up as the third result, and since it’s still relevant …