Hacker News new | ask | show | jobs
by whitegrape 3726 days ago
Seems odd to lump Python (which is pretty strongly typed) with Ruby and JavaScript (JS especially not being strong). Edit: Actually this whole thread makes it seem like we all have our own different definitions on what makes something "strongly typed" (or just confusion with strong and static). For myself, a language's type system's relative strength is all about how it handles (or doesn't handle) implicit type conversions.
2 comments

This is roughly my point.

“Strong” and “Weak” are inherently relative terms; so, when used without a reference point, they will mean something different to different people. So, without a point of reference, the terms are not useful.

Even being inherently relative, you still need to determine the underlying values with some metric (like implicit type conversions, or max deadlift). If you tell me someone's max deadlift is twice their bodyweight, that tells me they're strong, even if it doesn't tell me their relative strength compared to say Sigmarsson. If someone says "Language X generally forces you to be explicit with your type conversions" that tells me it's strongly typed. Is it more strongly typed than language Y? That depends on explicitness exceptions -- e.g. Java does implicit autoboxing and toString()ing when you're doing string concatenation, Go effectively type aliases primitives so that e.g. net.IP can implicitly convert to []byte, Python complains when you don't explicitly call str() on things but converts numbers pretty freely (like auto-converting to a bignum, whereas other languages might throw an exception or automatically and silently wrap-around to a much smaller number than expected).
“Strong typing” doesn't mean anything when comparing languages. The difference between raising a `TypeError` at runtime or silently doing something wrong is entirely a matter of standard library design. For example, you can replace Python's built-in lists with your own list class that is as “weakly typed” as you want. But, from the point of view of programming languages, the only thing that matters is that an unwanted situation couldn't be ruled out by the language itself.
I lump them since they are the traditional "dynamic scripting" languages popular in backend development. But I agree the strong/weak designations are actually not so neatly segmented.