3 ms·
Half of what you wrote here has nothing to do with the context of this discussion (again), and the half that's at least superficially relevant is materially irr
by cxr 3y ago
Half of what you wrote here has nothing to do with the context of this discussion (again), and the half that's at least superficially relevant is materially irrelevant as a consequence of being a strawman.
> Java programmers don't think they hit NPEs, C++ programmers don't think they have ("modern") memory issues, and dynamic programmers don't think they have type problems
Aside from the obvious category error, you aren't talking to a "dynamic programmer" who "[doesn't] think they have type problems". (It may also shock you to learn that I'm not an advocate of NodeJS/NPM, the programming style exemplified by the Adobe project identified in the blog post, or even TypeScript. That doesn't change the fact that I'm right about the things I said before—and the fact that I am right means it wouldn't matter even if I were a "dynamic programmer", anyway.)
The _entire_ point of what I wrote is laid out in my first paragraph: "People accustomed to strongly typed languages and thinking mostly of monolithic apps always pin things on dynamic typing even where it's not the cause." I even made it more explicit. This problem is not because of dynamic typing. This is a problem because of code mobility and separate compilation. I even provided references, FFS. You'd get the _same_ problem in languages that are not JS or TypeScript—including static languages. Why? Because this is a problem arising from code mobility and separate compilation—not static versus dynamic typing.
> What really prompted me to comment was your suggestion that it would have been better to skip the confusing checks
Not what I said, Holmes. The strength of your powers of divination don't merit the confidence you seem to have in them.
This is where I exit.
- mrkeen 3y agoI don't know how you can think I'm arguing some mysterious, unrelated tangent. -------------- >>>> {If `useControlledState` were just vanilla JS and no one were doing typechecking during development and build [1]}, there would have been {no problem with passing something else as an argument [2]}, because it will of course {evaluate to NaN anyway [3]} when undergoing the number treatment. >>> The point of typing is to make sure this situation [3] doesn't happen. >> Did you take note of the context in which this conversation is taking place? Because it doesn't make sense as a response within that context. > What really prompted me to comment was your suggestion that it would have been better to {skip the confusing checks [1]}, {keep passing through an untyped object [2]}, and {let some downstream expression blow up [3]}. -------------- >>> It's not about dynamic typing in this case. >> It is about dynamic typing I feel like you are so selectively blind to { isNaN(defaultValue) ? NaN : defaultValue; } being a wart of dynamic typing (not to mention TFA who had to slow down to understand it) that I couldn't do anything but submit other examples of selective blindness to see if they struck home: >> Java programmers don't think they hit NPEs, C++ programmers don't think they have ("modern") memory issues, and dynamic programmers don't think they have type problems. Why is it that you can write "People accustomed to strongly typed languages and thinking mostly of monolithic apps" but you bristle when I write "dynamic programmers"? > The _entire_ point of what I wrote is laid out in my first paragraph: "People accustomed to strongly typed languages and thinking mostly of monolithic apps always pin things on dynamic typing even where it's not the cause." I even made it more explicit. This problem is not because of dynamic typing. It's crystal clear and I'm contradicting you, not missing your point.
- cxr 3y agoWhat matters is not whether you—or any other confused commenter stuck in the second panel of the glowing brain meme—contradicts what I'm saying, but whether the facts do. They don't. You have missed the point, and not just once. Not even twice. > I feel like you are so selectively blind to { isNaN(defaultValue) ? NaN : defaultValue; } being a wart of dynamic typing You seem selectively blind to the fact that (1) the code you are referring to is statically typed, not dynamic; and (2) that I have already addressed this—not even as part of some back-and-forth with you, but before you even waded in to this conversation with your condescending attempt to explain "the point of typing". (Gee, thanks.)