News for hackers. Stuff that matters.
Re:Ask HN: Why choose a dynamically typed language? by Groxx on Saturday August 07, 2010 @05:28PM (#1584363)
>Maybe it's because all of my projects are small and I don't have to program defensively, but I've never been bitten by a type error that took anywhere near as long to fix than I would have spent using a static type system.

One of my projects for school turned into a 9k LOC Ruby project. I had precisely zero errors during the entire development cycle that static typing would've detected. Meanwhile, attempting a bit of dynamic code in VB.Net recently resulted in easily a couple hours worth of total waste dodging types while not going totally type-less. And then there's the crappy lambdas and total lack of anonymous or inner functions, so you end up polluting your namespace massively in many cases. (stuck in 3.5 + VS 2008, 2010 adds those) Gah!

I do occasionally miss IDE hinting, which is drop-dead easy in statically-typed languages. But dynamically typed languages allow such ridiculously simple APIs I find it's rarely necessary.

Re:Ask HN: Why choose a dynamically typed language? by Confusion on Sunday August 08, 2010 @04:17AM (#1585050)
I had precisely zero errors during the entire development cycle that static typing would've detected.

You never get a

  NoMethodError: undefined method `[]' for :foo:Symbol
or similar? Then you are either a much better programmer than me, or we are dealing with confirmation bias[1]. I get such errors regularly. They are trivial to fix and are caught early by tests/specs, but they are still there on a first iteration.

[1] http://en.wikipedia.org/wiki/Confirmation_bias

Re:Ask HN: Why choose a dynamically typed language? by Groxx on Sunday August 08, 2010 @02:00PM (#1585750)
No doubt that accounts for some of it, yes. But I'm extremely careful what I put into my variables, especially in larger projects, and especially in this one because everything was extremely highly connected. Chuck something in wrong once, and it could take me hours of hunting to find it; it wasn't worth being tricky.
Re:Ask HN: Why choose a dynamically typed language? by shadowfox on Saturday August 07, 2010 @07:40PM (#1584574)
Not to argue. 9K is comparatively small.
Re:Ask HN: Why choose a dynamically typed language? by Groxx on Saturday August 07, 2010 @07:56PM (#1584592)
As compared to a lot of commercial products, absolutely. But it was still a significantly larger project than I'd attempted before, and I probably ended up writing a good 30k or 40k through the whole time (attempting lots of new things).

It's also still over 10x larger than the .Net project with which I've been fighting. And given my patterns of code, I see no reason why making my previous project 10x larger would have any more difficulties with typing than I had before. In a few years of Ruby coding, I can only recall a few immediately-identified type problems. Static typing seems to me to cost significantly more than its value.

Re:Ask HN: Why choose a dynamically typed language? by gaius on Sunday August 08, 2010 @04:43AM (#1585075)
You can get a lot done in 9 kLOC Ruby/Python/etc. Possibly 10x what you could get done in as much Java.