News for hackers. Stuff that matters.
Re:The Year of C++ Successor Languages by jcelerier on Monday January 02, 2023 @09:31AM (#34218225)
Signaling to caller has already been shown to be a complete mistake with java checked exceptions, I don't understand why people persist with this. It makes for ridiculous code.
Re:The Year of C++ Successor Languages by jstimpfle on Monday January 02, 2023 @09:48AM (#34218410)
Are you saying that "not signaling" has not been shown to be a total maintenance nightmare as well?

Because the only way it is not ever a maintenance nightmare is when you really don't care that function execution could be aborted at any point without any visual clue. And the only way I can see you wouldn't care is when you go 100% in to everything-context managed / RAII or similar. And that again, sorry but I can't be arsed to prematurely rip everything into little pieces like that. It makes for terrible code IMO.

Re:The Year of C++ Successor Languages by mike_hock on Tuesday January 03, 2023 @04:01AM (#34229413)
But you can be "arsed" to write an error handler after almost every single function call?
Re:The Year of C++ Successor Languages by jstimpfle on Tuesday January 03, 2023 @06:36AM (#34230278)
I explained here that I consider having to check many return values to be a smell: https://news.ycombinator.com/item?id=34217251

And from my own experience, no I don't have to check a lot of return values.

Re:The Year of C++ Successor Languages by masklinn on Monday January 02, 2023 @11:10AM (#34219491)
> Signaling to caller has already been shown to be a complete mistake with java checked exceptions

It's not signalling which has been shown to be a complete mistake, but checked exceptions, more specifically as implemented by Java.

Signalling works just fine and is actually rather enjoyable when done well.

Re:The Year of C++ Successor Languages by kllrnohj on Monday January 02, 2023 @12:01PM (#34220259)
Can you point to an example? What has "signaled exceptions"?
Re:The Year of C++ Successor Languages by masklinn on Saturday January 07, 2023 @06:06AM (#34287042)
> Can you point to an example?

Rust, Swift, Erlang, Haskell, ...

> What has "signaled exceptions"?

Java.

It's not clear what you're asking.

My comment noted that signalling the possibility of errors to caller (in general) is valuable.

jcelerier objected with java's checked exceptions as a counter-example, as they signal to the caller, but they're shit.

However that's not a counter example, that's just java's checked exceptions being a shitty implementation of the idea.