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

Ah I didn't realize I had replied to the same person in different places. Sorry about that haha.

> I know this, I just call coercion "autoconversion" because the data is typically given a new form as well as a new box.

Hmm interesting. I think I dislike this because coercion is not always automatic, so the "auto" part of "autoconversion" is a hang-up for me. For example, doing `int("3")` in Python is an explicit coercion, but I don't think it would qualify as an "autoconversion" (unless I'm not quite understanding your definition of that term). In the interests of clarity until I understand better, I'll continue using "coercion" and I'll specify implicit vs. explicit as needed.

> Having autoconversion without casting is a sign of a strong type system, because you can't turn off the type system, you are only allowed to use it.

I agree for explicit coercion, but not with implicit.

If your coercion is implicit, then the user has no control over what's going on. The type system is essentially transforming values' types behind the curtain in an effort to prevent errors. This means that errors which the user might believe should be raised may not be. The type system is "weak" because it's not holding types rigidly with respect to the user's perspective. The user's perspective is key, because if we look at things from the language's perspective then almost any language could be viewed as strongly typed given the right theoretical framework.

> "Problem" in the sense of our discussion being incomplete, nothing more.

Totally fair!



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

Search: