Send to Printer

development

This could explain a lot

January 9, 2005 18:16:32.189

Sam Gentile has a revelation while learning Python - and I think his explanation of his former bias explains a lot of how people talk past each other on dynamic typing:

VBScript, on the other hand, is a weakly typed language because you can concatenate the string '12' and the integer 3 to get the string '123', and then treat that as the integer 123, all without any explicit conversion. Also, unlike VBScript, Python will not allow you to reference a variable that has never been assigned a value. Then it hit me. I have been (naively) biased against late/dynamically bound languages because of the crap that is VBScript. This is coupled with Everything Is An Object. This is the kind of type system that has flexibility but certain safety at the same time and I can deal with that. It may not mean much to others but it unlocks a huge door for me.

Comments

[Sam Gentile] January 9, 2005 23:12:02.824

The example is Mark Pligrim's straight out of the book word for word, not mine. Are you saying it's incorrect? I'm not sure that I understand the context since you had a chance to educate me and instead chose the usual disdain and putdown.

Server down

[Vincent Foley] January 9, 2005 23:34:15.565

Sam: I think James is saying that you thought that Python's typing system, because it is dynamic, was like VBScript's and that this could explain why so many people think that dynamic typing is the same thing as weak typing.

This could explain a lot

[ James Robertson] January 10, 2005 0:10:35.112

Comment by James Robertson

Sam, it's not meant as a put down. I'm saying that your post points out how so many of us - myself included - talk past each other when we discuss typing issues. We all come at the topic with biases, and we don't usually recognize them. I wasn't going for insult at all - rather, I was trying to point out the sensibility of your post

Thanks Guys

[Sam Gentile] January 10, 2005 0:16:25.848

Thanks for the clarifications both. You both captured what I was after with the post. On with the learning!

"12" + 3

[Yanick Beaudet] January 11, 2005 4:54:16.098

To add to the confusion regarding static and dynamic, weakly and strongly typed is the fact that the "12" + 3 test is generally associated with weakly typed languages, but in C# you can do "12" + 3 and it will happily return a string. The mechanism underneath is not the same, but to the observer it appears to be.

How then to best explain that the "12" + 3 of python is not the same as the "12" + 3 of VBScript is not the same as the "12" + 3 of C# when they look so similar? I think this has some to do with why programmers are easily confused about which is which and then talk at cross-purpose about it...

 Share Tweet This