Compare commits

...

2 Commits

Author SHA1 Message Date
Patrick Stevens
975a37a108 Bump deps (#16) 2024-07-24 18:39:07 +01:00
Smaug123
bff167f362 Simplicity of code post 2024-07-24 17:53:11 +01:00
2 changed files with 28 additions and 7 deletions

14
flake.lock generated
View File

@@ -122,11 +122,11 @@
"scripts": "scripts_2"
},
"locked": {
"lastModified": 1710545132,
"narHash": "sha256-73ISG6KO966t2gvfhLolCy9XvJbjmFiGwxjaAyD3vkg=",
"lastModified": 1721842442,
"narHash": "sha256-bjvLR/KwHToz0/kRcZ8/MHXs3y4YCTtz3UUQ/D/AliA=",
"ref": "refs/heads/main",
"rev": "8fcf3013c0480e3d7c4b55e2f8f5dc7afde51ade",
"revCount": 23,
"rev": "cab3ccc58ec12af893c9ea6b87aac0dfeefa3752",
"revCount": 24,
"type": "git",
"url": "file:/Users/patrick/Desktop/website/static-site-images"
},
@@ -188,11 +188,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1713023617,
"narHash": "sha256-acok2VJ8nNqm2C5FmM727Kju6GMEJ5AmRAMUou20KBw=",
"lastModified": 1721841206,
"narHash": "sha256-0Q3zNYro6m8v9r2yB35y+AlGmrxmiLBcFhR5Hqto/6c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ea497abce1f2f64b5cac8be2047e024957dc96a",
"rev": "a1159ff6c68901142ae41788387bc4c841f190b2",
"type": "github"
},
"original": {

View File

@@ -0,0 +1,21 @@
---
lastmod: "2024-07-24T17:38:00.0000000+01:00"
author: patrick
date: "2024-07-24T17:38:00.0000000+01:00"
title: Code having "the right philosophy"
summary: "Those who would give up essential safety, to purchase a little temporary simplicity, deserve (and will get) neither safety nor simplicity."
---
[Hacker News](https://news.ycombinator.com/item?id=41032806):
> Time library can be simple, it's just rust libraries tend to be philosophic for some reason, but it's only one of many design approaches.
Certainly a true statement.
I claim that the "some reason" here is that this "philosophic" design approach is correct, and the other ones aren't.
Most standard libraries (.NET, Golang, Python) don't care about correctness enough that they'd actually *model the domains* in question, so they don't, so they make it trivial to write completely unnecessary bugs.
As evidence, I submit the fact that I have twice had to rewrite someone else's .NET code to fix time-related bugs in it, whose ultimate direct cause was "the .NET `DateTime` type is an extremely bad model for dates-and-times in the world".
In one of those two cases, I ended up completely rewriting the entire application, using NodaTime to drive the date-time computations, because that's a library that actually attempts to model dates-and-times.
Those who would give up essential safety, to purchase a little temporary simplicity, deserve (and will get) neither safety nor simplicity.