Is this a bug in every Markdown (Extra) parser?


The Markdown logo.

Markdown is, I think it is fair to say, a frustrating "specification". It's origins are a back-of-a-fag-packet document and a buggy Perl script - and we've been dealing with the consequences ever since. There are now multiple Markdown parsers, each with their own idiosyncrasies. To make matters worse, there's a set of extensions popularly known as "Markdown Extra". Extra has support for things like tables, footnotes, and - in some dialects - autolinks. Most of the time, when an author writes …

Continue reading →

LLMs are good for coding because your documentation is shit


A pet cat typing on a computer keyboard.

That's it. That's the post. Fine! I'll expand a little more. Large Language Models are a type of Artificial Intelligence. They can read text, parse it, process it using the known rules of English, and then regurgitate parts of it on demand. This means they can read and parse a question like "In Python, how do I add two numbers together?" and then read and parse the Python documentation. It will produce an output like: What happens if you search the official Python documentation for…

Continue reading →

Falsehoods Programmers Believe About Weather


Hundreds of snowflakes - each one unique and beautiful.

(Mostly written in response to this issue on the Awesome Falsehoods list) For those new to the format, there is a popular meme about things which computer programmers erroneously believe. This isn't intended to shame anyone - just to point out things which may not be immediately obvious to the neophyte. There's nothing us Brits love more than moaning talking about the weather. And, just as Inuit speakers have hundreds of words for snow, so English speakers have hundreds of words for rain. …

Continue reading →

Server-Side Rendering of Embedded Markdown Code Snippets in WordPress


The Logo for WordPress.

Because I'm a grumpy old man, I don't use Gutenberg or Block themes on my WordPress. Instead, I write everything in Markdown. When I write code snippets in Markdown, they look like this: ```php $a = 1; echo $a; if ($a < 5) { // Do Something return thing( $a, true ); } ``` But I want to render that with code highlighting. I was using the Prismatic Plugin. It is excellent and very customisable. But it uses JavaScript to do the code highlighting. I want to respect my readers' time and …

Continue reading →

There should only ever be one way to express yourself


Logo of the Python programming language.

I've been thinking about programming languages and their design. In her book about the divergence of the English and American languages, Lynne Murphy asks this question: wouldn’t it be great if language were logical and maximally efficient? If sentences had only as many syllables as strictly needed? If each word had a single, unique meaning? If there were no homophones, so we’d not be able to mix up dear and deer or two and too? That got me thinking about the creativity which can be exp…

Continue reading →

The Joy and The Pity of making your own stuff


A thin block of white beancurd.

I made my own tofu a few weeks ago. I got soy milk, heated it, mixed in coagulants, drained it, pressed it, sliced it, then cooked it. And, you know what? I'm not sure it was worth the effort. It tasted basically fine - no different to any shop bought tofu. It wasn't noticeably cheaper, it wasn't more nutritious, nor was it easier to store and prepare. I'm sure that if I spent several attempts I would gradually get closer to creating something comparable with the shop-bought product. And …

Continue reading →

Free Open Banking API using Nordigen / GoCardless


Screenshot from GoCardless. 1. Test with your own data See how the product flow would look like for your users and what data is available 2. Set up the API Follow our documentation to set up the API and start collecting bank account data 3. Customise the user interface Pay as you go Make the user agreement flow for your customers to match your brand 4. Ready to go live? Need help and advice to set up faster?

A few weeks ago I was moaning about there being no OpenBanking API for personal use. Thankfully, I was wrong! As pointed out by Dave a company called Nordigen was set up to provide a free Open Banking service. It was quickly bought by GoCardless who said: We believe access to open banking data should be free. We can now offer it at scale to anyone - developers, partners and Fintechs - looking to solve customer problems. And, I'm delighted to report, it works! As a solo developer you can…

Continue reading →

Why aren't there more visual programming languages? (An ode to DRAKON)


Part of the MD5 algorithm expressed in colourful Lego blocks.

I think the computer programming industry is about to reach a reckoning. No, not because ChatGPT can poorly plagiarise buggy code - but because a whole generation of kids have grown up with Scratch. And they'll want professional tools which have Scratch's level of usability. Hand-coding YAML files is a mug's game; one wrong whitespace and everything is broken. Left a semi-colon off the end of a line of code; watch the compiler moan. Mixed up your ints, floats, and strings; the computer has a…

Continue reading →

Are there any modern closed-source programming languages?


Four generated images of William Shakespeare programming a computer.

At a recent OpenUK meetup, one of the participants declared that Open Source had comprehensively won. While businesses might not always release their proprietary source code, 100% of everything they wrote used an open source programming language. I wondered how true that was. You can, perhaps, moan about the shenanigans around Java's licencing and you mutter about whether it is easy to get involved with C++'s JTC1/SC22/WG21 - but the core tech behind the two is open. Anyone can read the…

Continue reading →

Regular Expressions make me feel like a powerful wizard - and that's not a good thing


A confused little cardboard robot is lost amongst the daisies

(This is a rant because I'm exhausted after debugging something. If you've made RegEx your whole personality, I'm sorry.) The other day I had to fix a multi-line Regular Expression (RegEx). After a few hours of peering at it with a variety of tools, I finally understood the problem. Getting that deep into the esoteric mysteries made me feel like a powerful wizard with complete mastery of my domain. And I think that's dangerous. I'm sure we've all read a story about a witch or wizard who…

Continue reading →

Unicode operators for semantically correct programming


Why do most programming languages use the / character when we have a perfectly good ÷ symbol? Similarly, why use != instead of ≠? Or => rather than →? The obvious answer is that the humble keyboard usually only has around 100 keys - and most humans have a hard time remembering where thousands of alternate characters are. Some programming fonts attempt to get around this with ligatures. That allows the user to type <= but have the font display ≤ Are there any modern programming languages whic…

Continue reading →

Book Review: The Programmer's Brain - What every programmer needs to know about cognition by Felienne Hermans


Book cover for the Programmer's Brain.

There are some books which make you feel smarter just by having them on your shelf. This is one of them! I would consider it essential for anyone working with code - whether a wide-eyed newbie or grizzled veteran. How do human brains understand code? What neurological quirks do we all have? Which common mistakes can be easily avoided? Only by understanding our puny hardware ("Isn’t it a miracle that humans can do anything with no more than 1 byte of memory") can we understand how we should r…

Continue reading →