HNHacker News
TopNewBestAskShowJobs

HendrikHensen

162 karma · joined November 30, 2025

submissionscomments
HendrikHensen··on Kotlin's rich errors: Native, typed errors without exceptions
Correct. Although the performance characteristics are different. An exception in Java generates a stack trace, which is relatively expensive. So not a great idea in un-exceptional code paths that need to perform well.
HendrikHensen··on Kotlin's rich errors: Native, typed errors without exceptions
The biggest problem is that people treat it as a dichotomy: either exceptions or error values. But that's a false dichotomy.

There would be real value in a language which would have both.

Error values are perfect for un-exceptional errors, e.g. some states of a business logic. The name that the user entered is invalid, some record is missing from the database, the user's country is not supported. Cases that are part of the business domain and that _must_ be handled, and therefore explicitly modeled.

Then there is the grey area of errors that one might expect (so not truly exceptional) but are not related to the business logic. These could be for example network timeouts, unexpected HTTP errors (like 503), etc. For those, there is often no explicit handling in the domain that makes sense. So it's convenient to just throw an exception, let it automatically "bubble" to the highest level (e.g. the HTTP controller) and just return some generic error (such as HTTP 500).

There are also truly exceptional cases, that you really shouldn't encounter in your program, such as null-dereferences, invalid array index access, division by zero, etc. These indicate a bug in the code (and might be introduced explicitly with assert-style checks). The program is in an unknown, compromised state, so there's really nothing left to do than throw an exception or panic. An error value makes very little sense in this case.

I often have the discussion with friends, why a division operator, or an array access, doesn't return a `Result` type in nice languages such as Rust? Surely, if they care about error values, then each operation that can fail, must return a `Result` rather than panic (throw an exception). It is an interesting through experiment at least.

HendrikHensen··on Kotlin's rich errors: Native, typed errors without exceptions
> Rust and Go call these panics but they are implemented like exceptions.

I don't know about Rust, but a very important difference between Java exceptions and Go panics, is that a Go panic kills the entirely process (unless recovered), whereas a Java exception only terminates the thread (unless caught).

It's a little off-topic, but I wanted to clarify that for passer-bys who might not know.

HendrikHensen··on Show HN: I quit coding years ago. AI brought me back
Is there any backend component? How do you know it's secure and you won't be hacked? Can you comment on the maintainability of the code?
HendrikHensen··on Below the Surface: Archeological Finds from the Amsterdam Noord/Zuid Metro Line
All your stuff would be historical artifacts a century from now. Do you ever just throw anything away? You should consider preserving it instead, for the generations that come after you. How will they feel if they knew you just threw historical artifacts in the garbage bin?

That is to say, keeping anything historical has its limits. If we always keep everything historical, we will keep literally everything, and the planet will be quite full pretty quickly, with no place to build anything.

We should be careful to preserve truly historically relevant things. But most historical things are just old trash...

HendrikHensen··on STFU
Go to the stall next door, play pooping and farting noises on your phone, very loudly.
HendrikHensen··on A Year of Work on the Arch Linux Package Management (ALPM) Project
The fact that you personally haven't encountered an issue, doesn't mean that no issue existed.
HendrikHensen··on Worst of breed software
Just last week at my job we apparently converged on a Kubernetes deployment to host a static site, due to company security policies related to publicly exposing buckets to the internet... I died a little inside that day.
HendrikHensen··on What happened to WebAssembly
It helps if you actually qualify statements such as "Containers are absolutely miserable things". I'm in a world where were using containers extensively, and I don't experience any issues whatsoever about which one might thing "WASI would be the solution to this".
HendrikHensen··on AI coding assistants are getting worse?
Can you be more specific? E.g. refute something specific that the article mentions. Or are you only reacting to the title, not the article's contents?
HendrikHensen··on Sergey Brin's Unretirement
It's honestly a bit confusing to use words to mean things that they don't generally mean.

Retirement has the definition to stop working. One could argue that another definition may be that you reach an older age and start receiving pension payouts (regardless of whether you keep working or not).

But having a passive income alone simply doesn't mean retirement.

HendrikHensen··on Why is the Gmail app 700 MB?
Well, something fishy is going on because there is literally no way that Safari, in its entirety, is 5.1 MB. The numbers for the others app seem similarly off.

It would be really hard to believe that somehow Apple has found some magic formula to make their apps 100x smaller than Google and Microsoft.

Much more likely is that the reporting by the OS is off somehow (probably most of the app functionality is tied up in shared resources counted towards system files, and not counted towards the app's size).

With respect, I would expect more from articles posted on Hacker News. More thorough research, and in fact an answer to the question.

HendrikHensen··on Brave overhauled its Rust adblock engine with FlatBuffers, cutting memory 75%
What were you using before that? I never see any ad in Firefox with uBlock Origin. I can't imagine it's much of a difference experience than with Brave.
HendrikHensen··on Why Microsoft Store Discontinued Support for Office Apps
It's telling that even Microsoft itself doesn't believe in the Microsoft Store.
HendrikHensen··on Python numbers every programmer should know
Having general knowledge about the tools you're working with is not a distraction, it's an intellectual enrichment in any case, and can be a valuable asset in specific cases.
HendrikHensen··on Manus AI 100M USD ARR
Since it's an AI company, and not actually doing anything by hand, it wouldn't surprise me if they came up with the name "manus" because it has "anus" in it, and then designed the hand logo due to the Latin meaning of the name. [this is a sarcasm, in case that was not clear]
HendrikHensen··on Rob Pike goes nuclear over GenAI
This is how we're going to destroy humankind.
HendrikHensen··on You’re not burnt out, you’re existentially starving
> This solves it for most, but secular society has lost any structural capability to succeed in this.

Can you explain how you see a causation between religion and marriage success?

HendrikHensen··on You’re not burnt out, you’re existentially starving
> I don't think people should have kids because they otherwise lack meaning

I'm past the age where I can (or rather should have) kids and I have to say, the past decade or so I'm more and more thinking that people SHOULD have kids to have (more) meaning in their life. Put it another way, I've begun thinking that having children is a nice way to have a default baseline of meaning in your life. I really see that with all my friends, who all have kids.

HendrikHensen··on You’re not burnt out, you’re existentially starving
As an aside, I really don't like these kinds of titles. They presume a lot about the (potential) reader without knowing anything about them. And it sounds like it's stating some kind of a fact but it really isn't. Different people are afflicted by different problems, you can't just make such a blanket statement about everyone.
HendrikHensen··on Log level 'error' should mean that something needs to be fixed
> Should only “top-level” code ever log an error? That can make it difficult to identify the low-level root causes of a top-level failure.

Some languages (e.g. Java) include a stack trace when reporting an error, which is extremely useful when logging the error. It shows at exactly which point in the code the error was generated, and what the full call stack was to get there.

It's a real shame that "modern" languages or "low level" languages (e.g. Go, Rust) don't include this out of the box, it makes troubleshooting errors in production much more difficult, for exactly the reason you mention.

HendrikHensen··on Avoid UUID Version 4 Primary Keys in Postgres
In Google Cloud Bigtable we had the issue that our domain's primary key was a sequential integer autogenerated by another app. So we just reversed it, and it distributed automatically quite nicely.
HendrikHensen··on Go Proposal: Secret Mode
With good helpers, it could become something as simple as

    key := make([]byte, 32)
    defer scramble(&key)
    // do all the secret stuff

Unless I don't understand the problem correctly.
HendrikHensen··on Advent of Code 2025
You're right, it looks like these days you have to fill in an email address. Though any random thing can be filled in. They will send a verification code, and on the next screen you can either fill it in or click Skip in top right. Then in the preferences, it can be removed from the account. A bit annoying for sure, but still not valid email address needed.

But it is true that at any time they could make using an email address or phone number mandatory, and then creating an Advent of Code account will be gated behind that.

HendrikHensen··on Accepting US car standards would risk European lives
> This seems to be concerning but as a Dutch person who has lived in the UK for a long time the relatively recent home-grown 'fatbike' issue seems to be a much more pressing problem for Dutch road safety than this and isn't being dealt with effectively as far as I understand.

This is the appeal to worse problems fallacy. Both are problems, both need to be addressed.

HendrikHensen··on Advent of Code 2025
The "etc" is pretty important here. You can log in using Reddit, and you can create a random throwaway Reddit account without filling in any other details (no email address or phone number required).
← PreviousPage 2 of 2