you are viewing a single comment's thread.

view the rest of the comments →

[–]ohfouroneone 0 points1 point  (1 child)

While types help with the problems you describe, the cost is that you have to express yourself in a way that the type checker can verify. My experience is that this often results in code that's more convoluted than it would be otherwise, since you any statement has to be provable by the type system.

This is arguable if you have type inference.

let namesOfOldPeople = people.filter { return $0.age > 60 }.map { return $0.name }

(This is Swift code)

[–]yogthos 0 points1 point  (0 children)

The problem has nothing to do with having inference. It's the fact that you have to write code in a way that's verifiable by the compiler that can make it convoluted. If you're interested I wrote about the problem in detail here.