3 ms·
I've used Scala for a few years, at work designing and implementing a backend REST API. The language has well-documented warts. I don't like all parts of the P
by rvense 10y ago
I've used Scala for a few years, at work designing and implementing a backend REST API.
The language has well-documented warts. I don't like all parts of the Play framework that we use. It's slow to compile and sometimes the error messages are weird. If you miss a close-curly brace you'll sometimes just get a completely impenetrable type error, things like that.
But honestly, all that I can live with. Case classes, sealed traits, function types, generics, monadic error handling... So much application logic can be expressed at the type level where it gets mechanically checked. The only errors that get past the compiler are in JSON parsing and database interaction. Everything else just works after it compiles. I've refactored and redone abstractions that touch all other components of the code, and I'll do it and deploy on a friday afternoon and go home without worrying. I trust the code, even after changing it. I have integrations tests that spin up the backend with a real database and send it HTTP requests, but nothing like complete test coverage. I'd like to add that out of principle, but it doesn't feel necessary.
Scala has warts. But it works well and it has static types without the verbosity of Java. I can't imagine going back to an untyped language plus tests again.