News for hackers. Stuff that matters.
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.