3 ms·
In college I was required to take a course using SML (which has a type system that is sort of like Haskell's I think; Haskell's may have been based on it). I wa
by mtdewcmu 13y ago
In college I was required to take a course using SML (which has a type system that is sort of like Haskell's I think; Haskell's may have been based on it). I was not all that academically driven that semester, and I was kind of taken by surprise by how hard the language was, once I started doing the later projects, and I barely got through the course. That was my only exposure to functional programming until after college, when I wanted to make up for that and I undertook to learn Scheme. I didn't have much trouble with Scheme, and the functional concepts I'd heard about in the course finally made sense. If you're trying to learn the functional style, I don't see the point in learning at the same time a complex type system. The type system isn't a natural consequence of functional programming, it's something that's not really related but adds a lot of difficulty.
I don't want to start a flame war, but I view types as being sort of peripheral to the task of getting the computer to do things. If type systems are getting in the way of programming, priorities are getting mixed up.
- klibertp 13y agoThat's why I love Typed Racket - it's powerful and expressive, yet completely optional and integrates seamlessly with untyped code. It helps that Racket has the best support for contracts I've seen though.
- gu 13y agoType systems aren't supposed to "get in the way of programming". Instead, they are supposed to assist you, and they do. This is why there is the perception that, for instance, code written in languages like OCaml commonly turns out to be correct once it compiles correctly. It's certainly not the case that language designers deploy a complex type system to make your work harder.
- mtdewcmu 13y agoI don't question that they're created with the best intentions, but the most important thing is the end result, not the programming language. And well-intentioned language features don't always work out like they're supposed to.
- gu 13y agoIs this a problem of the language or the person using it?