4 ms·
> It's wonderful to not have null. Except that you do anyway! If you hit a NPE in Scala, you're doing something objectively wrong. You should be wrapping any
by mi100hael 10y ago
> It's wonderful to not have null. Except that you do anyway!
If you hit a NPE in Scala, you're doing something objectively wrong. You should be wrapping any calls to Java libraries that may return null with Option().
- MrPowers 10y agoI agree that null should generally be banned from Scala code, but your statement is a little too strong. I use Spark / Scala for big data applications and Option() is slower than null. From the Databricks Scala style guide: "For performance sensitive code, prefer null over Option, in order to avoid virtual method calls and boxing."