Hacker News new | ask | show | jobs
by the_af 4183 days ago
Interesting! Didn't know that. But note two things:

1- In the more general case, you cannot enforce a rule to disallows clumsy/inelegant code. You cannot force proper use of the language.

2- In the Option/null case, this is an education problem. My boss is an old-school programmer with lots of experience (and I've seen him successfully solve and/or prevent real problems at work that bit every other team, so by no means I want to sound disrespectful of his experience), but he simply doesn't understand why Option is needed. He claims "defensive programming should be enough" (i.e. checking for null at every turn). He claims "academia is not good for anything", and I guess he sort of believes Scala is an academic language full of fancy but not really useful constructs. He is not completely sold on functional programming, pattern matching, etc. So I cannot simply have the language complain about nulls, because I must justify the enforcement of this rule to my boss, and he isn't convinced. (Note: this isn't limited to Option values; think of almost every feature/coding style from Scala that might sound unfamiliar to Java programmers, and it's the same problem with my boss).