3 ms·
That's what we have valgrind, test cases and decent software engineers for. Java don't forget suffers as do other languages from lots of nasty things related t
by harrytuttle 13y ago
That's what we have valgrind, test cases and decent software engineers for.
Java don't forget suffers as do other languages from lots of nasty things related to types including invalid casts, null reference exceptions etc. When these go phut in production, you're usually in the same situation.
- pkinsky 13y agoJava is not a good example of a statically typed language. Null pointer exceptions just don't happen in idiomatic Scala. For example, let's say I have 3 functions a,b and c, each with signature Int => Option[Int]. Any one of these can return Some[Int] or None. Options, like all collections, can be chained together as such: for { x <- a(1) y <- b(x) z <- c(y) } yield z this expression is of type Option[Int], and will never throw a null pointer exception. (Futures can be chained together with identical syntax)
- seanmcdirmid 13y ago> Null pointer exceptions just don't happen in idiomatic Scala. But match exceptions do. Anyways, if I had to choose between unsound static type checking and sound dynamic type checking, I would definitely choose the latter.
- happy_dino 13y ago> But match exceptions do. I'd call that non-sense.