The Changelog: Software Development, Open Source - Avoiding the soft delete anti-pattern (News)
Episode Date: May 13, 2024Tim Fisken explains the problem with soft deletion, a simple measure of software dependency freshness is proposed, a deep-dive on sound design in software, a web app with over 80 handy developer tools... built in & Luke Plant reminds us that programming mantras are proverbs, not laws.
Transcript
Discussion (0)
What up nerds, I'm Jared and this is Changelog News for the week of Monday, May 13th, 2024.
Over the weekend, OpenAI teased a big announcement for today, which made many people guess they
are going to launch a search engine.
Turns out no, it was a desktop app, a slightly better GPT-4 model, and other goodies.
But this wave of rumors begged the old Netflix HBO question.
Can OpenAI become Google faster than Google can become OpenAI?
My money is on neither.
Open source for the win, of course.
Okay, let's get into the news.
Avoiding the soft delete anti-pattern.
I've hard deleted. I've soft deleted. I've never found a pattern that I like. In the linked post,
Tim Fiskin explains the problem with soft deletion and lays out a number of better ways of ensuring
access to old data. Quote, the main problem with soft deletion is that you are systematically misleading the database. This is most obvious in the case of foreign key constraints. End quote.
Fact check, true. But what can we do instead? Tim lists four alternatives. One, YOLO, just hard
deleted. Two, lifecycle, using archive state. Three, temporal tables, which is lots of timestamps. And four, data warehouse,
which is not my problem. I think each of these can make sense in different situations,
but I tend to believe YOLO plus appropriately granular backups are the general strategy
most people should start with. A simple measure of software dependency freshness. A LIBYR is a newly proposed single number telling you how up-to-date your dependencies are.
For example, Rails 5.0.0, which was released in June of 2016, is one LIBYR behind Rails 5.1.2, which was released in June 2017.
Why LIEar? Quote, there are more nuanced ways to calculate
dependency freshness, but this approach is simple. You can explain this calculation in 30 seconds.
End quote. I do appreciate the simplicity of this measure. To determine the overall freshness of
your system, just add up the LibEars and see what you see. Quote, if your system has a one-year-old
dependency and a three-year-old dependency,
then your whole system is four Libyers old, end quote.
In addition to explaining this simple proposal,
the linked website also provides Libyer calculation tools
for many common languages and ecosystems.
The Sound of Software.
This is the last in an excellent four-part series
on the role sound plays in software design.
I previously covered part three, the world's most satisfying checkbox.
Quote, sound is an outcast in software design.
We may embrace the aesthetics of animation and visuals, but sound is different.
It's intrusive.
Unlike visuals on a screen, you can't look away or ignore it.
It's enough to make you rip the batteries out of a toy or frisbee an iPad across the room, speaking from experience. And yet, play a video game without
sound and its powerful punch lands with no force. Without music, once moving moments in a film
become dull, even comical. Sound holds an immense power to elevate any experience, including the most
boring of software, end quote. This is a
must-read for anyone who designs software and hasn't thought seriously about the sound design.
They cover when to use sound, what makes good sound design, implementation details,
and how to get started. Good stuff. It's now time for Sp news. Find slow queries and errors in your database. Supabase and Sentry are
teaming up to put on a workshop on May 16th that you might want to check out. Quote, in this
workshop, the Supabase developer relations team will demo connecting a Next.js project to Supabase
and integrating Sentry. Learn how Supabase can improve the performance and scale of your End quote.
Here's what you can expect.
An overview of Supabase and how Sentry helps.
Connecting a Next.js project to Supabase.
How to integrate Supabase with Sentry.
And code level context and metrics
available in Sentry.
The event is completely free.
Once again, that's May 16th.
Sign up today by following the link in your chapter data and newsletter to reserve your
spot.
And thank you once again to Sentry for sponsoring ChangeLog News.
Handy tools for developers.
The linked web app hosts 80 plus little tools you might need as you go about your daily development work.
It has generators like for UUIDs, passphrases and QR codes.
It has converters like JSON to CSV, YAML to TOML and TOML to JSON.
And it has web tools like URL parsers, slugifying strings, emoji pickers. It has,
well, you get the point. It has a lot of stuff. And since each tool is implemented as an open
source Vue.js component, it's super easy to poke under the covers and copy how they work
into your own code base. Programming mantras are proverbs. A good reminder from Luke Plant that it's easy for us to take
programming mantras like dry, yagni, wet, etc. too much like laws and not enough like proverbs.
Why proverbs? Quote, proverbs encapsulate a small bit of wisdom in a pithy phrase,
but you still need to learn to apply that wisdom correctly. Good Proverbs are
also supposed to make you think. They slow you down before you leap into something that is likely
to be bad, or they help you reflect on what did go wrong. End quote. He goes on to illustrate this
using Proverbs 26, 4, and 5, a favorite of mine, which says, quote, do not answer a fool according
to his folly, or you yourself will be just like him. Answer a fool according to his folly or you yourself will be just like him.
Answer a fool according to his folly or he will be wise in his own eyes, end quote. Luke's overarching
point is that we need to slow down and think through our decisions versus blindly following
a rule or a mantra. It depends. This is why I have long had a mantra of my own, slow down to go faster.
That is the news for now,
but don't forget to scan the companion ChangeLog newsletter for even more,
including the search for easier, safe systems programming,
how Ahrefs gets a billion dollars worth of infra
with a 90% discount,
and Slop is the new name for unwanted AI-generated content.
If you aren't plugged into the newsletter, sign up today at changelog.com slash news.
It costs exactly $0.
We have some great episodes coming up this week.
Burke from Polar on Wednesday and Alex from Tailscale on Friday.
Have a great week.
Leave us a five-star review if you dig it, and I'll talk to you again real soon.