Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"In a weakly typed language a compiler / interpreter will sometimes change the type of a variable. For example, in some languages (like JavaScript) you can add strings to numbers 'x' + 3 becomes 'x3'. This can be a problem because if you have made a mistake in your program, instead of raising an exception execution will continue but your variables now have wrong and unexpected values. In a strongly typed language (like Python) you can't perform operations inappropriate to the type of the object - attempting to add numbers to strings will fail. Problems like these are easier to diagnose because the exception is raised at the point where the error occurs rather than at some other, potentially far removed, place. In a statically typed language, the type of variables must be known (and usually declared) at the point at which it is used. Attempting to use it will be an error. In a dynamically typed language, objects still have a type, but it is determined at runtime. You are free to bind names (variables) to different objects with a different type. So long as you only perform operations valid for the type the interpreter doesn't care what type they actually are." [0]

It might help you to do research, ask clarifying questions, or explain why you think someone is wrong; instead of assuming that anyone saying something you disagree with has no idea what they are talking about.

[0]http://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%...



> It might help you to do research

When it comes to that precise subject, I happen to have already done so and to know the count rather well. Stupidity is stupidity, even if it's on the python.org wiki.

> or explain why you think someone is wrong

I did so. Twice if not thrice. There is no well-defined and shared — let alone formal — semantics (and meaning) to the strong/weak "axis", every other person has his own pet definition of it[0] and the definitions are quite often incompatible if not downright opposed.

It is therefore garbage and utterly useless to communication.

> instead of assuming that anyone saying something you disagree with has no idea what they are talking about.

It's not "anyone saying something [I] disagree with", just "anyone using the strong/weak axis as if it actually existed".

[0] From "no memory corruption" to "no possible runtime error" through "no UB", "dynamically typed" and all sorts of takes on "no implicit conversions", usually in order to declare one's pet language is "strong" and somebody else's is "weak". I've seen all of C, C++, Python, Javascript, Perl, Java, Tcl, Lua, Smalltalk or Pascal declared both strong and weak by various (usually different) people.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: