Programming mantras are proverbs

I believe that many of the arguments we have around software development practices could be avoided by the simple understanding that all of our mantras need to be understood as proverbs and not laws. If you understand proverbs, then you’ll know that every proverb has an equal and … | Continue reading


@lukeplant.me.uk | 11 days ago

Enforcing conventions in Django projects with introspection

Some code and tips to combine Python and Django introspection APIs to enforce naming conventions in your Django models. | Continue reading


@lukeplant.me.uk | 1 month ago

Python packaging must be getting better - a datapoint

I’m developing some Python software for a client, which in its current early state is desktop software that will need to run on Windows. So far, however, I have done all development on my normal comfortable Linux machine. I haven’t really used Windows in earnest for more than 15 … | Continue reading


@lukeplant.me.uk | 3 months ago

Python Type Hints: pyastgrep case study

In a previous post, I did a case study on my attempts to add type hints to parsy. In this post, I’m continuing the series, but in a very different project. A while back I forked an existing tool called astpath to create my own tool pyastgrep, fixing various bugs and usability iss … | Continue reading


@lukeplant.me.uk | 7 months ago

Super-fast Sphinx docs

var script = document.createElement('script'); script.src = "https://unpkg.com/htmx.org@1.9.5" script.integrity = "sha384-xcuj3WpfgjlKF+FXhSQFQ0ZNr39ln+hwjN3npfM9VBnUskLolQAcN80McRIVOPuO"; script.crossOrigin = 'anonymous'; script.onload = function() { System Message: ERROR/3 (, l … | Continue reading


@lukeplant.me.uk | 8 months ago

Is the Lord's Day the Christian Sabbath?

Most of this post was written a long time ago, but I thought it would be useful to have somewhere public that I can point people to for my answer to this question, so I’m finally publishing it. At the outset, I need to say that this issue is one that I think Christians should not … | Continue reading


@lukeplant.me.uk | 8 months ago

Is the Lord's Day the Christian Sabbath?

Most of this post was written a long time ago, but I thought it would be useful to have somewhere public that I can point people to for my answer to this question, so I’m finally publishing it. At the outset, I need to say that this issue is one that I think Christians should not … | Continue reading


@lukeplant.me.uk | 8 months ago

No-one actually wants simplicity

The reason that modern web development is swamped with complexity is that no one really wants things to be simple. We just think we do, while our choices prove otherwise. A lot of developers want simplicity in the same way that a lot of clients claim they want a fast website. You … | Continue reading


@lukeplant.me.uk | 9 months ago

You can stop using user-scalable=no and maximum-scale=1 in viewport meta tags now

Many websites are still using a viewport meta tag like one of the following: These days, you can almost certainly remove the maximum-scale or user-scalable properties, to leave: This is the same as suggested by HTML5 boilerplate, so it should be a pretty good default for most … | Continue reading


@lukeplant.me.uk | 11 months ago

Re-using CSS for the wrong HTML with Sass

Recently, while writing up some examples and pattern for using htmx with Django for form validation, I discovered a new trick for using externally defined CSS without having to change the HTML you are working with. To make it concrete, an example might be that you are using some … | Continue reading


@lukeplant.me.uk | 11 months ago

Django and Sass/SCSS without Node.js or a build step

Although they are less necessary than in the past, I like to use a CSS pre-processor when doing web development. I used to use LessCSS, but recently I’ve found that I can use Sass without needing either a separate build step, or a package that requires Node.js and npm to install … | Continue reading


@lukeplant.me.uk | 11 months ago

ChatGPT: abstract logic and the doubling down bias

This is the third in a short series of posts about ChatGPT’s capabilities and flaws. First I noted that ChatGPT often makes things up because that’s what it was designed to do. Second, it lacks an “inner monologue” and meta-cognition. In this post, I’ll take a brief look at its r … | Continue reading


@lukeplant.me.uk | 1 year ago

ChatGPT: it has no inner monologue or meta-cognition

This is the second in a series of short posts about ChatGPT. As I said before, the insights are not particularly original, I’m just raising awareness of issues. In this post, I’ll explore the deficiency that we could describe in human terms as “lacking an inner monologue”. Stephe … | Continue reading


@lukeplant.me.uk | 1 year ago

ChatGPT: it makes things up (that's its job)

This is the first in a series of short posts about ChatGPT based on my experience as this tool becomes more and more a part of my daily toolset. My insights are highly original, I’m just raising awareness of issues. ChatGPT can sound very human, and yet it’s behaviour is very unl … | Continue reading


@lukeplant.me.uk | 1 year ago

What if none of it is true?

At some point most Christians will have to face questions about the reality of the Christian faith. What if none of the things we believe are actually true? What if Jesus didn’t actually rise from the dead? I don’t think there are adequate reasons to doubt, but here are 3 answers … | Continue reading


@lukeplant.me.uk | 1 year ago

The different uses of Python type hints

When you use type hints in Python, you could be using them for one or more of at least 5 different things: Interactive programming help Many editors will be able to use type hints to give you help with: autocomplete (e.g. suggesting methods that actually exist on the type of obje … | Continue reading


@lukeplant.me.uk | 1 year ago

Python’s “Disappointing” Superpowers

In Hillel Wayne’s post “I am disappointed by dynamic typing”, he expresses his sense that the Python ecosystem doesn’t really make the most of the possibilities that Python provides as a dynamically typed language. This is an important subject, since every Python program pays a v … | Continue reading


@lukeplant.me.uk | 1 year ago

Accepting the paedo-baptised into credo-baptist churches

This post is about a long-standing debate in churches of a credo-baptist persuasion about whether you can accept those baptised as infants into membership, and I approach this as someone standing in the Reformed tradition, in the baptist tradition, meaning I believe that the Bibl … | Continue reading


@lukeplant.me.uk | 1 year ago

A model for the soul

This post is an attempt to give a model for thinking about the Christian concept of the soul. It is not a theory. Models vs Theories I’m loosely borrowing the language of models and theories from the scientific world. If you present a theory, you will often be expected to give a … | Continue reading


@lukeplant.me.uk | 1 year ago

Test factory functions in Django

When writing tests for Django projects, you typically need to create quite a lot of instances of database model objects. This page documents the patterns I recommend, and the ones I don’t. Before I get going, I should mention that a lot of this can be avoided altogether if you ca … | Continue reading


@lukeplant.me.uk | 1 year ago

Python Type Hints: case study on parsy

I have been trying to like static type checking in Python. For most of my Django projects, I get annoyed and give up, so I’ve had a go with some smaller projects instead. This blog post documents how it went with Parsy, a parser combinator library I maintain. Contents Intro to Pa … | Continue reading


@lukeplant.me.uk | 1 year ago

Tools for rewriting Python code

When writing (or reviewing) code, you have better things to do than concern yourself with low-level details about coding style or other changes that are essentially mechanical in nature. Thankfully, the tooling ecosystem for doing these kind of boring changes to Python code has b … | Continue reading


@lukeplant.me.uk | 1 year ago

Better Python code grepping with pyastgrep

A few weeks ago I released pyastgrep, a tool for grepping Python code at the syntax level (using AST - Abstract Syntax Trees), and today I released some more improvements. It builds on an earlier tool, astpath which now appears to be abandoned, and also had quite a few bugs. I’ve … | Continue reading


@lukeplant.me.uk | 1 year ago

Why escape-on-input is a bad idea (2012)

With examples from the web development world especially PHP, and lessons for Pythonistas | Continue reading


@lukeplant.me.uk | 1 year ago

The argument from unwanted children

Katharine Birbalsingh asked on Twitter: This makes a good argument IMO for abortion instead of madness we see on twitterHaving said that, it doesn’t mention real numbers or culture changeWould love to hear from my pro-life followers why this doesn’t convince (other than religious … | Continue reading


@lukeplant.me.uk | 1 year ago

REPL Python programming and debugging with IPython

The flows I use for exploratory programming using a REPL and their advantages. | Continue reading


@lukeplant.me.uk | 1 year ago

Raising exceptions or returning error objects in Python

How returning error objects can provide some advantages over raising exceptions in Python, such as for static type checking tools. | Continue reading


@lukeplant.me.uk | 1 year ago

The technological case against Bitcoin and blockchain

The technological case against Bitcoin and blockchain | Continue reading


@lukeplant.me.uk | 2 years ago

Digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

OTP/TOTP for two factor auth (2FA/MFA) is very easy to misunderstand and implement insecurely | Continue reading


@lukeplant.me.uk | 2 years ago

The Curse of Scalable Technology

Some of the downsides of technology stacks that are massively scalable and general purpose | Continue reading


@lukeplant.me.uk | 2 years ago

Avoid Django’s GenericForeignKey (2016)

Continue reading


@lukeplant.me.uk | 2 years ago

Yagni Exceptions

Continue reading


@lukeplant.me.uk | 2 years ago

We need less powerful languages

Continue reading


@lukeplant.me.uk | 3 years ago

Everything Is an X

Continue reading


@lukeplant.me.uk | 3 years ago

Test Smarter, Not Harder

Continue reading


@lukeplant.me.uk | 3 years ago

Why I’m Leaving Elm

Continue reading


@lukeplant.me.uk | 4 years ago

Pylint False Positives

Continue reading


@lukeplant.me.uk | 4 years ago

Why learning Haskell/Python makes you a worse programmer

Continue reading


@lukeplant.me.uk | 6 years ago