DEV Community

Juha Autero
Juha Autero

Posted on

You Can't Write Carrier Grade Software in Go

because it doesn't have assert.

Top comments (3)

Collapse
 
curtisfenner profile image
Curtis Fenner

The lack of assert is definitely the strangest omission in Go to me. They say they didn't include it because they were afraid programmers would use it instead of handling error cases, but I have literally never seen code and thought this code has too many asserts. Most code needs a whole lot more asserts, really.

Collapse
 
jautero profile image
Juha Autero

The joke is that I've seen lot of "carrier grade" code that is basically

ptr=malloc(BYTES);
assert(ptr);
Collapse
 
curtisfenner profile image
Curtis Fenner

well, tripping an assert is at least better than memory corruption ¯\_(ツ)_/¯