frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Why Go Can't Try

https://niketpatel.com/essays/why-go-cant-try
38•nexneo•4h ago

Comments

cryptos•1h ago
My takeaway is that Go almost always prefers simplicity and not so much good software engineering. `nil` without compiler checks is another example, or designing a new language without generics. However the overall simplicity has its own value.
sheept•17m ago
I agree, its strength (beyond goroutines) is that anyone who knows one of the popular languages (Python, Java, etc) can easily translate their idioms and data structures to Go, and the code would remain easy to read even without much Go experience. That's probably one reason why the TypeScript compiler team chose Go.

But this makes the language feel like Python, in some ways. Besides nil, the lack of expressivity in its expressions makes it more idiomatic to write things imperatively with for loops and appending to slices instead of mapping over the slice. Its structurally typed interfaces feel more like an explicit form of duck typing.

Also, Go has generics now, finally.

andriy_koval•9m ago
> he popular languages (Python, Java, etc) can easily translate their idioms and data structures to Go, and the code would remain easy to read even without much Go experience

disagree, they made many decisions which are different from mainstream: OOP, syntax as examples.

antonvs•15m ago
I think of it as a bit like Python with stronger types.

I'm not convinced that you couldn't have good software engineering support and simplicity in the same language. But for a variety of mostly non-technical reasons, no mainstream language provides that combination, forcing developers to make the tradeoff that they perceive as suiting them best.

advisedwang•1h ago
The Go team has discussed syntactic sugar for error handling many times. They're not against it, they're just holding out for a proposal that checks a lot of boxes and makes everyone happy, which hasn't happened yet.
verdverm•18m ago
It's a settled matter at this point for the foreseeable future

https://go.dev/blog/error-syntax

tl;dr - proposals are no longer being considered

release-object•16m ago
Example: https://go.dev/blog/error-syntax
fweimer•1h ago
It's more complicated. There is no single correct way to check for errors. Some standard library functions can return data and an error: https://pkg.go.dev/io#Reader
kbolino•1h ago
This is true, but it feels like a mistake. It's too late to change now, of course, but I feel like (0, nil) and (!=0, !=nil) should both have been forbidden. The former is "discouraged" now, at least. It does simplify implementations to allow these cases, but it complicates consumers of the interface, and there are far more of the latter than the former.
kbolino•1h ago
The author doesn't touch on it, but the bigger problem with things like Foo|Bar as an actual type (rather than as a type constraint) is that every type must have a default/zero value in Go. This has proven to be a difficult problem for all of the proposals around adding sum types, whether they're used as errors or otherwise. For example, to support interface{Foo|Bar} as a reified type, you'd have to tolerate the nil case, which means you either couldn't call any methods even if they're common to Foo and Bar, or else the compiler would have to synthesize some implementation for the nil case, which would probably have to just panic anyway. And an exhaustive type-switch would always have to have "case nil:" (or "default:") and so on.
candiddevmike•55m ago
> every type must have a default/zero value in Go

Hot take, maybe, but this is one of the few "mistakes" I see with Go. It makes adding QoL things like you mentioned difficult, requires shoehorning pointers to allow for an unset condition, some types don't have a safe default/zero value like maps, and makes comparisons (especially generic) overly complex.

verdverm•19m ago
Go specifically does not want to add QoL things because it means the compiler team has to spend time implementing that extra syntax and semantics versus making a minimal set of features better.
impure•1h ago
I really hate it when people try to justify Go’s design decisions. Try would be very useful. The real reason why is because the Go team refuses to take any lesson from any other programming language except for C. That’s why there are so many questionable decision. Also I was a little disappointed there was no mention of panics which are one such questionable decision. Also the author stopped trying to cover up their AI written tracks at the conclusion because you already read it so who cares.
scuff3d•1h ago
"Here's the uncomfortable truth: a try keyword in Go without fixing the error type is just syntax sugar. You'd get slightly less typing but none of the real benefits - no exhaustiveness checking, no compiler-inferred error sets, no guarantee that you've actually handled every case."

... So what? From what I can tell that's all anyone has asked for in the context of something to just return nil/error up the call stack.

BadBadJellyBean•52m ago
Exactly. I don't like that many people say "It's not perfect so it's useless.". I don't want to write or read the `if err != nil` statement over and over again. It is messy. It is tiresome. It could be solved by syntactic sugar.
peterldowns•47m ago
llm garbage
zoilism•31m ago
agreed, the author should be upfront that it was written by an LLM
edunteman•28m ago
The llm detector in my brain went off too
barelysapient•38m ago
Go got a ton right. Especially for being almost 20 years old. But errors is one thing that needs a v2. I love Zig's enumerable errors and deferErr function.
seethishat•30m ago
The programmer is explicitly throwing away the error returned by ReadFile (using the underscore) in the criticism of Go.

    data, _ := os.ReadFile(path)
Saying that is not explicit is just wrong.
skywhopper•25m ago
How utterly arrogant to insist that “every Go developer” wishes the language abandoned its principles in order to add some syntactic sugar to save a few lines of code. No, we don’t all feel a pang of envy at magic keywords that only work in certain function call configurations. Sheesh.

Motorola announces a partnership with GrapheneOS Foundation

https://motorolanews.com/motorola-three-new-b2b-solutions-at-mwc-2026/
1586•km•11h ago•561 comments

New iPad Air, powered by M4

https://www.apple.com/newsroom/2026/03/apple-introduces-the-new-ipad-air-powered-by-m4/
158•Garbage•4h ago•224 comments

First-ever in-utero stem cell therapy for fetal spina bifida repair is safe

https://health.ucdavis.edu/news/headlines/first-ever-in-utero-stem-cell-therapy-for-fetal-spina-b...
108•gmays•3h ago•7 comments

Show HN: Govbase – Follow a bill from source text to news bias to social posts

https://govbase.com
34•foxfoxx•1h ago•20 comments

Ask HN: Who is hiring? (March 2026)

74•whoishiring•2h ago•103 comments

/e/OS is a complete, fully “deGoogled” mobile ecosystem

https://e.foundation/e-os/
541•doener•9h ago•303 comments

Thirty years on, Pokémon is still a monster hit

https://www.economist.com/culture/2026/02/26/thirty-years-on-pokemon-is-still-a-monster-hit
33•andsoitis•3d ago•20 comments

Felix "fx" Lindner has died

https://blog.recurity-labs.com/2026-03-02/Farewell_Felix
65•is_taken•2h ago•8 comments

Reflex (YC W23) Is Hiring Software Engineers – Python

https://www.ycombinator.com/companies/reflex/jobs
1•apetuskey•1h ago

Launch HN: OctaPulse (YC W26) – Robotics and computer vision for fish farming

21•rohxnsxngh•1h ago•8 comments

Parallel coding agents with tmux and Markdown specs

https://schipper.ai/posts/parallel-coding-agents/
46•schipperai•4h ago•15 comments

Packaging a Gleam app into a single executable

https://www.dhzdhd.dev/blog/gleam-executable
26•todsacerdoti•2h ago•0 comments

Use the Mikado Method to do safe changes in a complex codebase

https://understandlegacycode.com/blog/a-process-to-do-safe-changes-in-a-complex-codebase/
84•foenix•4d ago•33 comments

How to talk to anyone and why you should

https://www.theguardian.com/lifeandstyle/2026/feb/24/stranger-secret-how-to-talk-to-anyone-why-yo...
400•Looky1173•11h ago•444 comments

Inside the M4 Apple Neural Engine, Part 1: Reverse Engineering

https://maderix.substack.com/p/inside-the-m4-apple-neural-engine
147•zdw•1d ago•46 comments

Zclaw – The 888 KiB Assistant

https://zclaw.dev
27•kristianpaul•2d ago•20 comments

Anthropic Cowork feature creates 10GB VM bundle on macOS without warning

https://github.com/anthropics/claude-code/issues/22543
292•mystcb•4h ago•152 comments

Why Objective-C

https://inessential.com/2026/02/27/why-objective-c.html
77•ingve•2d ago•64 comments

Notes on Lagrange Interpolating Polynomials

https://eli.thegreenplace.net/2026/notes-on-lagrange-interpolating-polynomials/
18•ibobev•2h ago•6 comments

Microsoft bans the word "Microslop" on its Discord, then locks the server

https://www.windowslatest.com/2026/03/02/microsoft-gets-tired-of-microslop-bans-the-word-on-its-d...
778•robtherobber•8h ago•317 comments

An Interesting Find: STM32 RDP1 Decryptor

https://carlossless.io/stm32-rdp1-decryptor/
63•carlossless•4h ago•15 comments

Making Video Games in 2025 (without an engine)

https://www.noelberry.ca/posts/making_games_in_2025/
336•alvivar•3d ago•156 comments

AMD Am386 released March 2, 1991

https://dfarq.homeip.net/amd-am386-released-march-2-1991/
70•jnord•5h ago•16 comments

Why Go Can't Try

https://niketpatel.com/essays/why-go-cant-try
40•nexneo•4h ago•23 comments

Mondrian Entered the Public Domain. The Estate Disagrees

https://copyrightlately.com/mondrian-public-domain-controversy/
161•Tomte•3d ago•89 comments

A plastic made from milk that vanishes in 13 weeks

https://www.sciencedaily.com/releases/2026/02/260227071922.htm
60•JeanKage•4h ago•54 comments

Show HN: Omni – Open-source workplace search and chat, built on Postgres

https://github.com/getomnico/omni
128•prvnsmpth•9h ago•36 comments

A bit of fluid mechanics from scratch not from scratch

https://tsvibt.blogspot.com/2026/02/a-bit-of-fluid-mechanics-from-scratch.html
18•surprisetalk•3h ago•3 comments

Apple AI servers unused in warehouses due to low Apple Intelligence usage

https://9to5mac.com/2026/03/02/some-apple-ai-servers-are-reportedly-sitting-unused-on-warehouse-s...
30•_____k•50m ago•7 comments

Language Model Contains Personality Subnetworks

https://arxiv.org/abs/2602.07164
8•PaulHoule•2h ago•0 comments