3 ms·
> errors being values Though with generics we could have the error values be less invasive. Learning the Scala mindset was eye opening. For e.g. the design pat
by inlined 7y ago
> errors being values
Though with generics we could have the error values be less invasive. Learning the Scala mindset was eye opening. For e.g. the design patterns of an Optional[T]’s primary code flow are the same as a Try[T,E].
With common transformation idioms, you learn to recognize code patterns the same way one might recognize data structures. It’s no less magical and it simplifies greatly.
- bmurphy1976 7y agoBut it doesn't simplify, it just moves the complexity around. That's not necessarily bad, you get better safety guarantees as a result but you also spend more time fighting the compiler and locked in design space trying to get a model that works (and even MORE time is spent if you want it to be readable and something that other people can grok quickly). I don't see this as an either/or situation. There's a continuum between do whatever the hell you want C and rigorously defined Idris code. Picking a spot on that line involves many trade-offs and everybody has to choose what's right for their situation. That means Go approach is sometimes superior to the Scala approach for a certain class of problems in certain domains. Edit: don't downvote me, tell me how I'm wrong.
- UK-AL 7y agoHonestly I think moving to towards Idris/coq level type systems saves more time in the long run. Being close c means you discover errors at run time, then you have to come back to cover them.
- bmurphy1976 7y agoFor humongous projects or critically important ones I'd agree with you, but for smaller/mid sized projects I can't agree. I think it's total overkill in many instances. Would be nice if there was a language that scaled from C to Idris gracefully, but C++ and Scala make me think that's a pipe dream.