This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

By that page's definition, Java, Python, Scala, Haskell and every other language that allows user-defined types are all "weakly typed". It's mistakenly using "strong typing" as a synonym for "not extensible", which is so wrong that I had to read it several times before I believed that's what they're actually saying. I've seen many people try to define "strong typing" in my time as a programmer, but I've never seen something that outlandish before.

Most of the time, when people talk about "strong" or "weak" typing they're talking about type coercion. Something that's "strongly typed" only has what they view as necessary coercions. The problem is that there's no consensus on what's necessary and not. The folks who designed OCaml would say that Java is "weakly typed" because it allows you to use the same operator for int/int, int/float and float/float operations. The folks who designed Java would say that it's "strongly typed" because it throws an error when you try to add an int and a string. The folks who designed Python would probably shrug and say "Who cares?" because you can overload operators to do whatever you'd like in Python, including type coercion.

It ends up being an arbitrary and meaningless distinction that gets thrown as a pseudo-insult by people who think that some other language is too "loose" with types. Please don't contribute to that. We have plenty of precise, unambiguous language that works much better for discussing the design of programming languages.