frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Excessive nil pointer checks in Go

https://konradreiche.com/blog/excessive-nil-pointer-checks-in-go/
18•ingve•2d ago

Comments

turtleyacht•2d ago
What about wrapping nil in a Maybe or Option type?
aarjaneiro•59m ago
This is more about a hard dependency which causes a function to early exit
flowerthoughts•54m ago
In this case, the missing piece in Go is the NonNullable hint. That would make it clear that null checks aren't needed, enforceable by the type system, and lintable.

Option types just forces you to do the check, but doesn't remove the need for it.

Now that we have generic types, a NonNullable intrinsic type seems doable...

sail0rm00n•52m ago
References like C++, maybe?
cubefox•36m ago
Or a set theoretic type system with union type declarations (foo|null), like in TypeScript.
bediger4000•2d ago
This is good advice for humans: they can quantify to decide "too many nil checks" or not. But it's not good for agentic coding, which we're entering the age of. Although agents are the worst they'll ever be right now, they're never going to be great at quantifying too many nil checks. I think we'll have to get used to far more nil checks than even bad programmers put in. But that doesn't matter to agents, they've got infinite attention spans, no cognitive bias and large working memories. Sonn we'll see no nil checks.
lenkite•23h ago
Delegate all `nil` and bad input checks to a validation framework and use it in all your constructor functions.
FridgeSeal•11m ago
I’ll go you one better: integrate it into your language and have the compiler enforce it for you!
usrnm•48m ago
Also known as contract programming vs. defensive programming. This argument is very old, is not specific to golang, and I have found myself on both sides at different points in my carreer.
diarrhea•39m ago
This is the mess a language lands on when it conflates optionality (a semantic concept) with references/pointers (purely a machine concept). In Go, the requirement "need (non-optional) a reference to an object" is simply not expressible. This is a solved problem in other languages, for example `&T` vs. `Option<&T>` in Rust.
throwa356262•24m ago
What the article said applies to Rust ref vs ref-option too.
Groxx•15m ago
Don't forget mutability! Go throws that on top too.
Animats•9m ago
In C++, that distinction supposedly exists. References should never be null, while pointers can be. But there's no enforcement.

    int& ref = *ptr;
ought to generate a panic for a null pointer. But it doesn't. They were so close to getting it right.

A 3D voxel game engine written in APL

https://github.com/namgyaaal/avoxelgame
8•sph•13m ago•0 comments

Developers don't understand CORS (2019)

https://fosterelli.co/developers-dont-understand-cors
161•toilet•6h ago•75 comments

Zigzag Decoding with AVX-512

https://zeux.io/2026/06/17/zigzag-decoding-avx512/
59•luu•3d ago•4 comments

Loupe – A iOS app that raises awareness about what native apps can see

https://github.com/mysk-research/loupe
250•Cider9986•20h ago•75 comments

Renting a sewing machine from the library

https://www.bbc.com/future/article/20260618-the-weird-and-wonderful-libraries-of-finland
211•sohkamyung•9h ago•107 comments

Building reliable agentic AI systems

https://martinfowler.com/articles/reliable-llm-bayer.html
78•sarangk90•3h ago•15 comments

Epoll vs. io_uring in Linux

https://sibexi.co/posts/epoll-vs-io_uring/
139•Sibexico•9h ago•37 comments

The 100k Whys of AI

https://lcamtuf.substack.com/p/the-100000-whys-of-ai
85•surprisetalk•2h ago•32 comments

Slow breathing modulates brain function and risk behavior

https://www.cell.com/neuron/fulltext/S0896-6273(26)00339-9
172•croes•9h ago•38 comments

Show HN: TownSquare, a tiny presence layer for websites

https://townsquare.cauenapier.com/
157•cauenapier•20h ago•80 comments

Public Service Announcement: Don't Say You Use AI for Writing

https://www.satisfice.com/blog/archives/488148
22•satisfice•3h ago•8 comments

15-minute at-home Lyme disease tick test

https://www.bostonglobe.com/2026/06/17/business/lyme-disease-tick-test/
99•bookofjoe•2d ago•47 comments

SMPTE Makes Its Standards Freely Accessible

https://www.smpte.org/blog/smpte-makes-its-standards-freely-accessible-openingstandards-library-t...
254•zdw•15h ago•76 comments

Guide to the TD4 4-bit DIY CPU

https://www.philipzucker.com/td4-4bit-cpu/
28•andrewstuart•2d ago•3 comments

UHF X11: X11 Built for VisionOS and Apple Vision Pro

https://www.lispm.net/apps/uhf-x11/
198•zdw•15h ago•37 comments

DOS Game "F-15 Strike Eagle II" reversing project needs DOS test pilots

https://neuviemeporte.github.io/f15-se2/2026/06/20/needyou.html
240•LowLevelMahn•17h ago•64 comments

Unauthorized alert sent to cell phones across Brazil

https://www.cnn.com/2026/06/20/americas/brazil-hackers-unauthorized-alert-latam
125•zdw•12h ago•87 comments

Excessive nil pointer checks in Go

https://konradreiche.com/blog/excessive-nil-pointer-checks-in-go/
18•ingve•2d ago•13 comments

When I reject AI code even if it works

https://vinibrasil.com/when-i-reject-ai-code-even-if-it-works/
163•vnbrs•7h ago•91 comments

Your brain was never designed for this much bad news

https://www.sciencedaily.com/releases/2026/06/260614012006.htm
147•colinprince•4h ago•100 comments

The Lost Story of Alan Turing's "Delilah" Project

https://spectrum.ieee.org/alan-turings-delilah
13•asdefghyk•3h ago•1 comments

Whole cross-sectional human ultrasound tomography

https://www.nature.com/articles/s41551-026-01660-4
66•lnyan•2d ago•11 comments

Linux eliminates the strncpy API after six years of work, 360 patches

https://www.phoronix.com/news/Linux-7.2-Drops-strncpy
188•simonpure•11h ago•158 comments

Project Fetch: Phase Two

https://www.anthropic.com/research/project-fetch-phase-two
57•stopachka•8h ago•21 comments

Running MicroVMs in Proxmox VE, the Easy Way

https://taoofmac.com/space/blog/2026/06/18/1845
11•zdw•1d ago•1 comments

Alice is impatient

https://brooker.co.za/blog/2026/06/19/waiting.html
91•birdculture•11h ago•26 comments

Armstrong Effect

https://en.wikipedia.org/wiki/Armstrong_effect
24•userbinator•4h ago•2 comments

Temporary Cloudflare accounts for AI agents

https://blog.cloudflare.com/temporary-accounts/
204•farhadhf•20h ago•109 comments

Show HN: StartupWiki – A Free Alternative to Crunchbase

https://startupwiki.tech/
193•shpran•16h ago•59 comments

PostgresBench: A Reproducible Benchmark for Postgres Services

https://clickhouse.com/blog/postgresbench
101•saisrirampur•13h ago•22 comments