2 ms·
Alice: Hey Bob, want to try my nifty new function? Bob: Sure, Alice, what does it do? Alice: It takes a string and it returns an integer. Bob: But what does
by pvorb 8y ago
Alice: Hey Bob, want to try my nifty new function?
Bob: Sure, Alice, what does it do?
Alice: It takes a string and it returns an integer.
Bob: But what does it actually do?
Alice: I told you. It takes a string and it returns an integer.
Bob: But what does it do with the string? What's it for? Why should I use it?
Alice: Hey, I just gave you the full documentation for my function. You have everything you need. Now go use it.
Bob: Um, no thanks. I like to know more about what I'm getting myself in to.
- ilovecaching 8y agoI think you're criticizing a language you have no experience in. Haskell development is type driven. You start by defining and constraining your types until you get a DSL to write signatures in. See the Idris O'reilly book for more on type driven development. By the time you've added type constrains through typeclasses, selected types named after the domain, and selected a suitable name for the function, it's possible to write against the signature with no knowledge of the body or comments. You're also forgetting that signature includes the name of the function. reverse :: [a] -> [a] is easy to understand by it's name and type.
- pvorb 8y agoI didn't critisize Haskell. I only criticized a statement about its type system. > You're also forgetting that signature includes the name of the function. That's what I wanted to point out. The name of a function is even more important than its types. Types alone seldomly give you the complete picture of what's going on in a function. Of course the name can be wrong whereas types can't, but the name is less likely to be wrong than a comment.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]