Firstly, the question of strong vs. weak typing is distinct from the question of dynamic vs. static typing. I have to admit, I haven't fully puzzled out all of the ramifications of dynamic typing but here's an important point from the wikipedia article on typing
"In dynamic typing, values have types but variables do not" (see http://en.wikipedia.org/wiki/Type_system for the full article) So here's a summary of my understanding: Static typing: a variable can only hold a value that is consistant with the variable type Dynamic typing: a variable can hold any type of value. Weak typing: A value might be implicitly coerced to a different type in order to suit the context in which it is used Strong typing: Any change to the type of a value must involve an explicit cast with a well defined meaning When VBScript allows you to add a numeric value to a string value, it coerces the numeric value to become a string value thus exhibiting weak typing behaviour. When Perl allows you to go my "$foo = new Foo()", it is exhibiting dynamic typing behaviour I have to say that I don't quite see the use case for dynamic typing either. I've programmed quite a bit in Perl and in Actionscript, both dynamically typed languages and I don't quite see how I was helped by the dynamic nature of the languages, I may well be missing the point though so I'd be interested in the views of other posse readers. On Apr 22, 7:06 pm, scphantm <[email protected]> wrote: > ive been looking a few languages the past few days, groovy, ruby being > the big two. i see all over the web people praising the world of > dynamic type languages and the same question keeps ringing in my head, > WHY IN THE WORLD WOULD YOU WANT A DYNAMIC TYPING LANGUAGE???? i came > to java from the VB and PHP world. both of those are dynamically > typed and it was that one thing that drove me nuts. especially in > working with teams of developers. when i moved to java and its static > typing system, everything finally made sense, tweetie birds were > flying, humming birds were humming around around and i was in love, i > found a language that is quick and has inherent type checking built in > at compile time. > > i just remember the disasters and amount of bugs that occured with me > in the dark days of (god help me) asp, vbscript, and to an extent PHP > and don't understand why anyone in their right mind would not want > their language of choice to be statically typed? ive heard the answer > of, well its easier, in this case in my mind easy=lazy. i don't get > it, please educate me. > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/javaposse?hl=en. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
