On Programming and Writing

My brilliant friend Salvatore Sanfilippo (otherwise known as antirez of Redis fame) has an interesting write-up on his website. How similar is programming to prose writing? After getting his own feet wet with novel writing, he is convinced that the two activities share many common traits. One year ago I paused my programming life and started writing a novel, with the illusion that my new activity was deeply different than the previous one....

May 25, 2021

Flask 2.0

Flask 2.0 has just been released. Along with it come many other major satellite releases: Werkzeug 2.0, Jinja 3.0, Click 8.0, ItsDangerous 2.0, and MarkupSafe 2.0. Across all projects, Python 3.6+ is now required, and comprehensive type annotations are supported. At a glance, I’d say that the biggest news is async views in Flask 2. Work has also been done around Werkzeug Request and Response classes to allow for better sync and async in the future (it’s not a public API yet....

May 14, 2021

dotnet SmtpClient should not be used

I am very late to the party, but today I learned that the good old dotnet SmptClient is considered obsolete and should not be used. Quoting the documentation: We don’t recommend using the SmtpClient class for new development because SmtpClient doesn’t support many modern protocols. Use MailKit or other libraries instead. (source) Interestingly, Microsoft is recommending a third-party open-source library as an alternative. I hope we’ll see more of that in the future....

May 4, 2021

School assignments that count: simulating the COVID outbreak with the C language

Giulia got an exciting assignment from her teacher: Write a C program that simulates (a simplified version of) COVID outbreak spreading across a population of 200 people. When a healthy person comes into contact with a sick person, the healthy person becomes ill, too. After some time, a sick person will recover. A recovered person cannot infect a healthy person nor become sick again after coming in contact with a sick person....

April 5, 2021

Get better at programming by learning how things work

When we talk about getting better at programming, we often talk about testing, writing reusable code, design patterns, and readability. All of those things are important. But in this blog post, I want to talk about a different way to get better at programming: learning how the systems you’re using work! This is the main way I approach getting better at programming. Once again, Julia Evans has great sensible advice up on her site....

March 27, 2021

Write libraries, not services? Not so fast

Write libraries instead of services is an interesting article I read a while ago. I cannot get it off my head. In an attempt to clear up my mind, I decided to sit down and write about it. I have been writing libraries for a good part of my life. Most of my earlier dev-work resides on thousands of computers in the form of libraries. More recently, I have been writing and deploying remote services....

March 25, 2021

Semantic Versioning Will Not Save You

The always brilliant Hynek recently posted Semantic Versioning Will Not Save You. Primarily targeted at consumers of SemVer-versioned packages, it is full of insightful advice. From my perspective as an open-source maintainer, I can tell you that versioning is hard. Judging when a new release is going to break backward compatibility is not as simple as it might seem on the surface, and Hynek does a great job explaining why. Sometimes it is also hard for me to tell if a change in a codebase classifies as a new feature, small improvement, or fix—subtle differences....

March 4, 2021

Reverse engineering an obfuscated codebase and fixing it in the process

Today’s mandatory reading is How I cut GTA Online loading times by 70%. As someone who’s been fighting the protection/obfuscation cat & mouse game for twenty+ years, let me tell you one thing. The way this guy reverse-engineered parts of the GTA5 codebase and then proceeded to single-handly triage and fix a long-standing (7+ years) performance issue is simply mindblowing. All he had to work with were heavily obfuscated dlls. This also shows how we, the protectors, are always playing a losing game....

March 2, 2021

Musings on Python's Pattern Matching

Pattern Matching is coming to Python, and I am not sure I like it. Don’t get me wrong, I love pattern matching. I use it all the time in F#. I am sure that once it lands in the language, it will be wildly adopted. So what’s the problem with Python’s pattern matching? The community, some core developers included, has expressed several concerns. The Python Steering Council has acknowledged them and is willing to look into improvements should they be proposed....

February 23, 2021

What I listen to while programming

What music do you listen to while programming?1 For me, it’s usually jazz, classical, electronic, lots of it, or nothing. There are some specialized websites and podcasts I sometimes recur to, like [Music for Programming][1]. Several Spotify playlists I dig a lot, [Every Day I’m Nerdin’][2] being one of them. What can I say? I am musically omnivore. However, I recently discovered something different: the [Field Recordings podcast][3]. “A podcast where audio-makers stand silently in fields (or things that could be broadly interpreted as fields)....

February 12, 2021