- From: Martin Thomson <mt@lowentropy.net>
- Date: Thu, 15 May 2025 10:05:36 +1000
- To: "Seph Gentle" <me@josephg.com>, "Guohui Deng" <guohuideng@microsoft.com>, "Roy Fielding" <fielding@gbiv.com>
- Cc: "Yoav Weiss" <yoav.weiss@shopify.com>, "HTTP Working Group" <ietf-http-wg@w3.org>, "Anne van Kesteren" <annevk@annevk.nl>, "Mark Nottingham" <mnot@mnot.net>
If you want a longer form of Seph's comment: https://educatedguesswork.org/posts/text-type-safety/
The section "NO PLATE" is simultaneously hilarious and horrifying.
"_" is "NO PLATE".
On Thu, May 15, 2025, at 07:16, Seph Gentle wrote:
> All of these answers seem like a bad design to me. It sounds like what
> you want is this:
>
> enum ContentEncoding {
> Known(string),
> Unknown,
> NotPresent
> }
>
> Using a sentinal value for “none” / null is Hoare’s billion dollar
> mistake. An unrecognised content encoding isn’t a type of content
> encoding at all. If you ask me, it shouldn’t be treated or stored as
> such.
>
> This design uses sum types - which means it isn’t always practical with
> modern databases and programming languages. I think I’ll never
> understand why languages like sql, c++ and go are missing sum types.
>
> -Seph
Received on Thursday, 15 May 2025 00:06:01 UTC