News for hackers. Stuff that matters.
Re:Why do dynamic languages make it more difficult to mainta... by mightybyte on Monday January 27, 2014 @02:21PM (#7132477)
You're right that it has a cost (although type inference can significantly reduce that cost). But...

From TFA:

"They write test cases for every identifier ever used in the program. In a world where misspellings are silently ignored, this is necessary. This is a cost."

So in a dynamic language the cost is still there. In fact, it's probably higher than in a static language because you have to build at least some of the infrastructure yourself. Well, I imagine some people would argue that in a dynamic language the cost is optional. And again, I point to type inference where sophisticated static languages achieve the same thing.

Re:Why do dynamic languages make it more difficult to mainta... by andybak on Monday January 27, 2014 @03:03PM (#7132788)
> In a world where misspellings are silently ignored, this is necessary.

How does "dynamic typing"="misspellings are silently ignored"? Maybe in some languages but that's not a corollary of dynamic typing.

Disclaimer: Haven't read TFA so shoot me down if the context makes this clear

Re:Why do dynamic languages make it more difficult to mainta... by mightybyte on Monday January 27, 2014 @03:20PM (#7132915)
TFA was talking specifically about Javascript there. But I think the overall point about the cost of testing applies to dynamic typing across the board.
Re:Why do dynamic languages make it more difficult to mainta... by nailer on Tuesday January 28, 2014 @01:40AM (#7135715)
How would one consider JS to silently ignore misspellings?
Re:Why do dynamic languages make it more difficult to mainta... by marcosdumay on Monday January 27, 2014 @04:11PM (#7133260)
Except that'll write those same tests on staticaly typed languages (except Haskell), because their typing system isn't powerfull enough to detect most bugs.

And yes, you'll need to do a little bit of infrastructure on the test cases, but you'll gain the extra power that comes with dynamic types, that makes everything (even writting tests) much easier. And, of course, your codebase can be much less "huge" with that extra power.

Anyway, all that thing is a big red herring. Nobody decides to create a huge codebase.

Re:Why do dynamic languages make it more difficult to mainta... by mightybyte on Monday January 27, 2014 @04:24PM (#7133344)
> but you'll gain the extra power that comes with dynamic types

What "extra power" are we talking about here? If we're talking about the power to pretend a bool is a string or vice versa, then no thanks, I'll pass. I suspect that a number of the things you are referring to that give you "extra power" are actually things that don't have anything to do with the type system like first class functions, tuples, etc. Static languages can have those things too, you know.

Re:Why do dynamic languages make it more difficult to mainta... by awj on Monday January 27, 2014 @05:13PM (#7133696)
> If we're talking about the power to pretend a bool is a string or vice versa, then no thanks

That's weak typing. JavaScript does this, Python and Ruby don't.

Typically when people bring up the power of dynamic languages it's in the ability to alter definitions. The ability to extend existing classes/objects is pretty powerful, and isn't always trivially duplicated in static languages.

Many concepts that can be painful in statically typed languages (creating/programming against new interfaces to existing types, reflection, delegation, etc) are easy as breathing with dynamic types. It's not a matter of can vs. can't so much as easy vs hard.

Re:Why do dynamic languages make it more difficult to mainta... by mightybyte on Monday January 27, 2014 @05:35PM (#7133854)
Oh right, my mistake.

s/pretend a bool is a string or vice versa/not know whether an object even has a certain method because it isn't added until runtime/

I'll grant you that this type of thing is more difficult in static languages. But in my experience, the need for this kind of dynamic behavior is quite rare in terms of lines of code. So I'll trade it away any day of the week for the ability to reason about my code with more guarantees. At their core, all bugs are situations where the programmer's expectations didn't match reality. In my experience programmers who are good at debugging are good at being able to question as much of what could be going wrong as possible. Strong static types are about reducing the amount of things we have to question.

Re:Why do dynamic languages make it more difficult to mainta... by dllthomas on Thursday January 30, 2014 @10:40PM (#7155102)
"Except that'll write those same tests on staticaly typed languages (except Haskell), because their typing system isn't powerfull enough to detect most bugs."

Agda is offended.