From cba8832900201d22cfb624ba4e42084796014627 Mon Sep 17 00:00:00 2001 From: horo <143025439+horo-fox@users.noreply.github.com> Date: Tue, 2 Apr 2024 18:37:08 +0900 Subject: [PATCH] filler --- src/content/journal/failing-loudly.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/content/journal/failing-loudly.md diff --git a/src/content/journal/failing-loudly.md b/src/content/journal/failing-loudly.md new file mode 100644 index 0000000..d2e875b --- /dev/null +++ b/src/content/journal/failing-loudly.md @@ -0,0 +1,16 @@ +--- +title: "Things should fail loudly!" +published: 4-1-2024 +summary: "A Python user talking about how they dislike JS" +--- + +I really don't like JavaScript's tendency to fail quietly. I understand the rationale: broken webpages are everywhere. But something about the pervasiveness of `undefined` just hurts me. + +Let's compare two possible approaches for handling external data: + +- throwing it into an unstructured blob and going through that +- converting it via a schema + +JavaScript seems to go with the first. It sucks. Special syntax for property access, conveniences for unexpected data, type coersion, etc. + +I don't have much of a point beyond that, because I do have a soft spot for TypeScript. I don't hate JavaScript as much as I probably should, and I use it for projects and I am fine poking at it for frontend development. Heck, I think CSS is scarier! But I do dislike how JavaScript lets errors pass silently.