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

As far as I'm concerned, that's a drawback. Ubiquitous default values are an attractive nuisance. One which C# had already demonstrated 10 years prior.

The removal of nil leading to the removal of ubiquitous default values would have been positive.




I think that's why people in this thread are calling it a tradeoff. It's a very attractive option that seems like a great idea until it breaks. In happy path having default values is better, in mixed path situations, having a separate and reserved way of saying something hasn't been touched is incredibly powerful


I think default values are a major flaw, much worse than nil. An unintended default value causes data corruption. All types should be nillable in my opinion, using types that have fallback to a default value is source of nasty silent bugs. In Java for example I would never use a primitive data type.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: