Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a Ruby folk, I somewhat agree. Unit testing is essential in a dynamic language otherwise things are going to blow up.

However, this doesn't really blow up the number of test cases. If you're unit testing dynamically typed languages versus unit testing statically types languages, there is negligible number of test cases that would exist in Ruby for the purposes of type checking (over said statically typed language; there are type checking cases for when you're switching on type, obviously).

In fact, I find that writing tests in a dynamic language becomes easier over time because of the abstractions that are easier to generate in dynamically typed languages. Some of those abstractions may be possible in statically type languages, but it's significantly more difficult.

Disclaimer: I've never written tests (only 'toy' code) in Haskell.



"However, this doesn't really blow up the number of test cases."

Sure. But what I tell non-static-typing people is that the effort to write the type sig is arguably less than any unit test you might write, and the typing eliminates at least some likely tests you might otherwise have to write.

Now, Haskell's type system introduces other concerns, and I haven't written enough to say how, overall, that compares to developing in Ruby.

", I find that writing tests in a dynamic language becomes easier over time because of the abstractions that are easier to generate in dynamically typed languages. Some of those abstractions may be possible in statically type languages, but it's significantly more difficult."

I ported some Haskell code to Ruby and found that there were a number of powerful high-level abstractions in Haskell that were damn hard for me to replicate in Ruby.

It may be an apples-to-oranges comparison, plus I need more Haskell experience to get a better feel for things, but so far I don't see Haskell as being in any way less capable in generating abstractions.

The issue may be that the two languages just offer different realms of abstractions, and trying to do Ruby-style abstractions in Haskell is as prone to pain as Haskell-style abstractions in Ruby.




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

Search: