Posts tagged: POSTS

A use case for Python assignment expressions

Python 3.8 (2019) added “assignment expressions”, aka the “walrus operator”. I generally like things that make Python more expression-oriented, like list comprehensions, but I’m ambivalent about these. It’s pretty easy to impair readability by using them overzealously. Is saving one line of code worth making it harder to notice that an assignment is happening? However, I’ve found a use case I like a lot. I use them in the Django Python shell when doing exploratory ORM queries.
Blog comments via Mastodon

Blog comments via Mastodon

I’ve replaced my Disqus comment integration with a Mastodon-powered solution. On posts where I’ve enabled comments, you’ll now see a “Load Comments” button and a “Reply” button, both of which talk to the Mastodon API.

Adding commenting to a static site is an interesting puzzle.

I like writing tests

I like writing tests

I enjoy writing tests because I love what they give me. I love knowing that I’m adding defense against breakage from future changes. I love thinking through how a feature is really supposed to work, and having the test capture that understanding. I love thinking about edge cases that the code should handle, and writing tests for them — especially if it turns out that the code under test didn’t yet handle them correctly, because that means I’ve just saved us from a bug.
The care and feeding of tickets

The care and feeding of tickets

I can be kind of a stickler about leveraging the ticket/issue tracker in software projects (which always seems to be Jira these days, but nevermind that). I write tickets carefully; I link to related issues; I add comments to note the status of work in progress, or to record info that’s important to the work to be done.

Ubuntu Budgie

Ubuntu Budgie

My recent reinstall of Ubuntu 21.04 (to fix some driver problems) reminded me there is more to the world than XMonad. I played with Gnome Shell 3 for a day, and it’s all right. I don’t hate it (and I didn’t hate Unity either).