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

50+ years and people still fail to grasp this.

You have to put something (an optional, or a default constructed object in a useless state) and all you did was to skip the null check. In case of optional, you introduced a stack rewind or a panic. Everything else stayed the same. Maybe that default even deleted the hard drive instead of crashing.

Coding is hard. "just don't code" is not the answer. You can avoid something, that doesn't mean it won't show up in some other fashion.




Again, if you disallow unwrapping and panicking at the CI level, you actually force your developers to properly handle these situations.


> You have to put something (an optional, or a default constructed object in a useless state)

No, you really don't. There is no default number, no default string, no default piece of legislation, no default function.




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

Search: