4 ms·
>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
by Groxx 16y ago
>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.
- shadowfox 16y agoNot to argue. 9K is comparatively small.
- Groxx 16y agoAs 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.
- gaius 16y agoYou can get a lot done in 9 kLOC Ruby/Python/etc. Possibly 10x what you could get done in as much Java.
- Confusion 16y agoI 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 http://en.wikipedia.org/wiki/Confirmation_bias
- Groxx 16y agoNo 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.