Hacker News new | past | comments | ask | show | jobs | submit login

If they required values to always be initialized, that would either require a concept of constructors (the whole OOP thing they tried to avoid), or require all struct fields to always be explicitly initialized at every instantation (which can get awkward), or allow specify default field values (which sounds like implicit magic Go tries to avoid too). In Go, by-value semantics is more common than in Java with its mostly by-ref semantics, so nil is less of an issue. It's also easier to implement (the allocator already memsets to zero for safety) So it's just a combination of factors, they took a bunch of shortcuts. Not defending it, but their choice makes sense, too.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: