frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Two Kinds of Error

https://evanhahn.com/the-two-kinds-of-error/
24•zdw•1d ago

Comments

noelwelsh•2h ago
I agree with this, and I'd add there are two modes of processing errors: fail-fast (stop on first error) and fail-last (do as much processing as possible, collecting all errors). The later is what you want to do when, for example, validating a form: validate every field and return all the errors to the user.
lexx•1h ago
Nice article. I agree with the differentiation. You could also classify them as errors that should be fixed and errors that should exist. Some would argue that validation errors are not really errors on a system level. They are only errors on the user level. On the system level they are a feature
metalliqaz•1h ago
This post seems to conflate using `throw`, `raise`, etc. with crashing. The idea that 'handling' an error does not involve `throw`/`catch`, `try`/`except` is very strange to me. The exception facility is often the most elegant way to check inputs, and if I remember correctly the Python documentation says as much as well.
taylorallred•1h ago
It makes me think that it's worth sitting down and considering what all the valid outcomes for a piece of functionality are. A user typing in a string in the wrong format is not necessarily "exceptional", whereas running out of memory while getting the input would be. I feel like programmers too often treat perfectly valid outcomes to be errors. For example, in Rust I'll see Option<Vec<Foo>> and I ask myself if we could just use the empty vector as a valid return value.
taylorallred•1h ago
Another interesting article on error handling: https://www.dgtlgrove.com/p/the-easiest-way-to-handle-errors
supermdguy•1h ago
I'd also add errors with third-party systems, which aren't the developer's or the user's fault, but which are probably worth handling nicely (e.g. retry with backoff).
joshdick•55m ago
This is 4XX versus 5XX errors in HTTP.
mjw1007•47m ago
It's common that if you extract a function or a module with a well defined interface, that function or module can't tell whether a "bad" input indicates an expected or an unexpected error.

For example division by zero often indicates an "unexpected" error, but it wouldn't if you were implementing a spreadsheet.

So to me the approach of using different forms of error reporting for the two kinds of error doesn't seem promising: if you imagine you had to implement division yourself, which kind of error should it report? Should you have two variants of every fallible function so the caller can choose?

tl2do•42m ago
The expected/unexpected distinction assumes you have the capacity to anticipate failures in the first place. But that capacity varies - even among experienced developers, everyone has blind spots shaped by their specific history. What's "obviously expected" to one senior dev is a surprise to another. The article's model is useful, but there's a prerequisite it doesn't address: the ability to expect is itself unevenly distributed.
thelittlenag•31m ago
I don't really like this article. There isn't anything particularly noteworthy to noticing that some computations have outcomes that allow some form of recovery, and other outcomes do not.

But there are some obvious follow up questions that I do think need better answers:

Why is recovery made so hard in so many languages?

Error recovery really feels like an afterthought. Sometimes that's acceptable, what with "scripting" languages, but the poor ergonomics and design of recovery systems is just a baffling omission. We deserve better options for this type of control flow.

Also, why do so many languages make it so hard to enumerate the possible outcomes of a computation?

Java tried to ensure every method would have in its signature how it could either succeed or fail. That went so poorly we simply put everything under RuntimeException and gave up. Yet resilient production grade software still needs to know how things can fail, and which failures indicate a recoverable situation vs a process crash+restart.

Languages seem to want to treat all failures as categorically similar, yet they clearly are not. Recovery/retry, logging, and accumulation all appear in the code paths production code needs to express when errors occur.

Following programming language development the only major advancements I've noticed myself have been the push to put more of the outcomes into the values of a computation and then further use a type system to constrain those values. That has helped with the enumeration aspect, leaving exceptions to mainly just crash a system.

The other advancement has been in Algebraic Effects. I feel like this is the first real advancement I've observed. Yet this feature is decried as too academic and/or complex. Yes, error handling is complex and writing crappy software is easy.

Maybe AI will help us get past the crabs at the bottom of the bucket called error handling.

IshKebab•9m ago
This sounds very neat in theory, but in practice errors are a continuum between these two extremes and there isn't really a clean dividing line.

Intel's make-or-break 18A process node debuts for data center with 288-core Xeon

https://www.tomshardware.com/pc-components/cpus/intels-make-or-break-18a-process-node-debuts-for-...
194•vanburen•3h ago•147 comments

MacBook Pro with new M5 Pro and M5 Max

https://www.apple.com/newsroom/2026/03/apple-introduces-macbook-pro-with-all-new-m5-pro-and-m5-max/
582•scrlk•8h ago•560 comments

GPT‑5.3 Instant

https://openai.com/index/gpt-5-3-instant/
237•meetpateltech•4h ago•156 comments

Claude's Cycles [pdf]

https://www-cs-faculty.stanford.edu/~knuth/papers/claude-cycles.pdf
380•fs123•11h ago•186 comments

An Interactive Intro to CRDTs (2023)

https://jakelazaroff.com/words/an-interactive-intro-to-crdts/
61•evakhoury•3h ago•9 comments

We've freed Cookie's Bustle from copyright hell

https://gamehistory.org/cookies-bustle/
43•sb057•2h ago•6 comments

Textadept

https://orbitalquark.github.io/textadept/
16•giancarlostoro•2d ago•0 comments

Voxile: A ray-traced game made in its own engine and programming language

https://elbowgreasegames.substack.com/p/voxray-games-pushes-major-update
31•spacemarine1•1h ago•5 comments

The Xkcd thing, now interactive

https://editor.p5js.org/isohedral/full/vJa5RiZWs
1051•memalign•11h ago•143 comments

Don't Make Me Talk to Your Chatbot

https://raymyers.org/post/dont-make-me-talk-to-your-chatbot/
8•pkilgore•20m ago•0 comments

Don't become an engineering manager

https://newsletter.manager.dev/p/dont-become-an-engineering-manager
264•flail•8h ago•196 comments

Physics Girl: Super-Kamiokande – Imaging the sun by detecting neutrinos [video]

https://www.youtube.com/watch?v=B3m3AMRlYfc
373•pcdavid•8h ago•57 comments

When AI writes the software, who verifies it?

https://leodemoura.github.io/blog/2026/02/28/when-ai-writes-the-worlds-software.html
84•todsacerdoti•6h ago•71 comments

Launch HN: Cekura (YC F24) – Testing and monitoring for voice and chat AI agents

60•atarus•8h ago•19 comments

Claude is an Electron App because we've lost native

https://tonsky.me/blog/fall-of-native/
86•todsacerdoti•5h ago•96 comments

Possible US Government iPhone-Hacking Toolkit in foreign spy and criminal hands

https://www.wired.com/story/coruna-iphone-hacking-toolkit-us-government/
127•alwillis•3h ago•37 comments

TorchLean: Formalizing Neural Networks in Lean

https://leandojo.org/torchlean.html
54•matt_d•2d ago•7 comments

I'm reluctant to verify my identity or age for any online services

https://neilzone.co.uk/2026/03/im-struggling-to-think-of-any-online-services-for-which-id-be-will...
836•speckx•8h ago•505 comments

Arm's Cortex X925: Reaching Desktop Performance

https://chipsandcheese.com/p/arms-cortex-x925-reaching-desktop
249•ingve•15h ago•148 comments

MacBook Air with M5

https://www.apple.com/newsroom/2026/03/apple-introduces-the-new-macbook-air-with-m5/
334•Garbage•8h ago•386 comments

Show HN: Explain Curl Commands

https://github.com/akgitrepos/explain-my-curl
28•akgitrepos•2d ago•0 comments

Rubio to World: Stop Doing the Exact Same Thing the US Just Did

https://www.techdirt.com/2026/03/03/rubio-to-world-stop-doing-the-exact-same-thing-the-us-just-did/
17•hn_acker•28m ago•0 comments

Disable Your SSH access accidentally with scp

https://sny.sh/hypha/blog/scp
83•zdw•3d ago•35 comments

I'm losing the SEO battle for my own open source project

https://twitter.com/Gavriel_Cohen/status/2028821432759717930
401•devinitely•9h ago•207 comments

GitHub Is Having Issues

https://www.githubstatus.com/incidents/n07yy1bk6kc4
180•Simpliplant•3h ago•116 comments

The Two Kinds of Error

https://evanhahn.com/the-two-kinds-of-error/
24•zdw•1d ago•11 comments

Payment fees matter more than you think

https://cuencahighlife.com/why-payment-fees-matter-more-than-you-think/
84•dxs•4h ago•54 comments

Show HN: Online OCR Free – Batch OCR UI for Tesseract, Gemini and OpenRouter

https://onlineocrfree.qzz.io
9•naimurhasanrwd•2h ago•2 comments

Intercepting messages inside Is­Dialog­Message, installing the message filter

https://devblogs.microsoft.com/oldnewthing/20260226-00/?p=112090
7•ibobev•4d ago•0 comments

Apple Studio Display and Studio Display XDR

https://www.apple.com/newsroom/2026/03/apple-unveils-new-studio-display-and-all-new-studio-displa...
199•victorbjorklund•8h ago•219 comments