Hacker News new | past | comments | ask | show | jobs | submit login

I spent 2 days last week hunting a bizarre bug that turned out to be ultimately due to a type ambiguity in how JDBC maps Java types to Oracle types. Admittedly this is not a language issue (well, it is on a deeper level), but it's the same sort of problem.

I don't know how much time I've lost in Java to checking, catching, and debugging stupid RuntimeExceptions that would easily be fixed by having a good type system, or writing idiotic boilerplate design patterns that you simply would not have to write if you had a good type system (or were using Clojure).

No language in the world will save you from having to think about your program's desired behavior, but that doesn't mean we should make it hard on ourselves to even implement the behavior we think we want.




> No language in the world will save you from having to think about your program's desired behavior, but that doesn't mean we should make it hard on ourselves to even implement the behavior we think we want.

Therein lies the rub. Is there no cost to static typing? Is it not complex? Is it sufficiently expressive? Does it never make it harder to implement the behavior we think we want?

Should everyone write everything in every program in as provable a way as possible? If not, why not?

As the example here shows, there is a cost in effort expended and complexity:

http://news.ycombinator.com/item?id=2062910

I'm quite glad people are working on these things, and they have genuine benefits. But to overstate the benefits and ignore the costs (as did the post to which I replied) is not productive.


>Does it never make it harder to implement the behavior we think we want?

I should ask why you're aiming at "never"? I prefer to quantify "how often it makes writing harder". It is more useful.

I think that types could make writing behaviour we want even easier. For example, you could use "session types" and be sure that your routers always understand each other. You can write complex algorithm while establishing its complex invariants in types and be sure you're correct.


Getting back to the original blog post, this is where an adjustable type-strictness system would come in handy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: