Hacker News new | ask | show | jobs
by crdoconnor 4108 days ago
>Not necessarily true, especially if you are using a language with type-inference or you are able to encode your logic in types.

I agree that it is not necessarily true, but the languages which manage to squeeze in static typing and still end up with programs that are shorter and sweeter than python's are all fairly niche right now, which carries its own set of problems.

>Additionally - what do you think unit tests are? They aren't additional code you have to write?

Never denied it for a second. There aren't any languages which don't require unit testing though, and there probably never will be. Let's not pretend otherwise.

>I'm not someone who thinks types completely reduce the need for testing, but I absolutely do not get why dynamic language fans are like "Uhg, I HATE having to write types", but then end up basically reimplementing a type system in a much more verbose testing framework.

I've never done this.

I'd wager that the amount of code I have to write, including tests, is less than in all other practical languages. Often much less. That is very valuable.

2 comments

I would guess a well done scala project would be at least one order of magnitude shorter than a comparable python project. You just can't get the same level of abstractions without a type system to help you out.
> I'd wager that the amount of code I have to write, including tests, is less than in all other practical languages. Often much less. That is very valuable.

It would take a very gerrymandered definition of "practical" to say that Python counts but F# doesn't, and I'm pretty confident F# would win that comparison for most problems. (If you'll allow me Scala, which is my language of choice and the one I use full-time at my job, I'm very confident it would win the comparison for the vast majority of problems)

And as someone who has coded both Python and Ruby on the job, and most recently Scala, I find the amount of time I'm debugging runtime errors much less in Scala, which is very valuable.

I also don't feel the amount of code I am writing to be all that significantly larger than what I was writing in Python/Ruby.

F# might, but I doubt scala would.