r/programming • • Sep 27 '26

Don't couple your Go code to GitHub

https://iain.rocks/blog/dont-couple-your-go-code-to-github
491 Upvotes

136 comments sorted by

View all comments

Show parent comment

2

u/chucker23n Sep 28 '26

I wonder how many of these footguns would’ve been prevented had Go been designed even just a decade later. For example, you can absolutely solve null in a better way, e.g. with control flow analysis. Swift and C# both played around with this concept in the late 2010s. I’m sure other languages had it earlier.

But what I see a lot of in the Go mailing list discussions is “I’ve never seen it be solved; therefore it cannot be solved” attitudes.

5

u/syklemil Sep 28 '26

Might be worth remembering that the discussions leading up to C++11 were among what led them to create Go in the first place, as well as a general attitude of rejection of "features".

Further, between ILT's declaration about not noticing bugs related to null pointers, as well as stating (as a response to something else)

This is a restriction expressed in the type system. Go intentionally has a weak type system, and there are many restrictions that can be expressed in other languages but cannot be expressed in Go. Go in general encourages programming by writing code rather than programming by writing types.

and Pike calling himself a philistine about types, I get the impression that they don't want to solve the null pointer thing, they want to write if err != nil checks, i.e. """write code""" (even though by the SRE book I'm fairly certain that code qualifies as toil).

I suspect if they'd been exposed to Swift, they'd have much the same reaction as Robert C. Martin did in 2016, where he bounced pretty hard on the entire idea of explicit nullability, and static typing altogether (prophesying that TDD was going to replace static typing).