3 ms·
I like the attitude, but can't help thinking that using a decent modern statically typed language prevents half of the problems that this article poses to solve
by skrebbel 15y ago
I like the attitude, but can't help thinking that using a decent modern statically typed language prevents half of the problems that this article poses to solve to begin with.
- tikhonj 15y agoThis really depends on what you mean by "modern statically typed language". If you mean something like Haskell, I agree with you but there are too many other differences to make Haskell and Ruby comparable. If you mean Java, then I'm not sure it prevents that many problems, but it does make developers less productive. If you mean something else (C#? Scala? F#? C++?) then I don't have enough experience to comment.
- chc 15y agoHow about just OCaml? It's much closer to Ruby than Haskell is, but it still gets the null-free H/M type safety.
- msluyter 15y agoThat's funny. As I was reading the slides, I was thinking about just how unconfident (in the sense of the presentation) most Java appears to me. I'm thinking specifically of the messily nested try/catch/finally blocks needed when creating a JDBC connection (finally cleaned up a little in 1.7). Or perhaps the abundance of stuff like if (foo != null and foo.getSomething()) { or even weird little conventions that you get used to, like if ("".equals(aString)) I think with some effort, you can avoid some of this sort of thing, but it's not always easy. (Or, perhaps you didn't intend to include Java as a member of the set "decent statically typed languages?" ;))
- skrebbel 15y agoJava isn't the best example, no :-) For example, its checked exceptions basically force dealing with them all over the code (if you want a nice API without seventy throws clauses, that is). The equals example you're giving is horrible indeed. My personal favourite, which is C# at the moment, also has the "null" misdesign so you're right about that. Still, none of the duck typing issues exist (other than the null checking, which admittedly does undermine my point). Also, the IDE helps you do it right, which gives you more confidence as you write the code.