4 ms·
I think you’ve misunderstood my reaction. I’m certain, and I have no doubt. I’m not motivated by fear, I’m motivated by experience. These kinds of dynamic featu
by eyelidlessness 6y ago
I think you’ve misunderstood my reaction. I’m certain, and I have no doubt. I’m not motivated by fear, I’m motivated by experience. These kinds of dynamic features that mimic static features are harmful to code comprehension and maintenance.
Since you asked, the tooling is pretty goodish with VSCode if you use typescript, but still misleading for dependencies (getters are just treated as readonly properties, setters are indistinguishable from writeable properties).
- rektide 6y ago> I don’t want to come off too harsh I feel like your original points were kind of ok. But this attitude of superiority & certainty, this conviction that these language features are never the right answer? > I’m not motivated by fear, I’m motivated by experience. In my experience, teams & individuals can have a lot of bad sad mad anecdotes they make for themselves. But other people can find & use the same tools & techniques very stably, successfully, & to good effect. I don't fully believe you, that you have this experience. That you've earned this ability to trash & insult a rather-wide piece of JavaScript & it's use. In a complete & total way, you've said no, that you alone are the only important voice & that you have total knowledge. This isn't only harsh... it's other unfavorable things too. Meddling with descriptors is absolutely something that can go wrong, and it's very hard to know it really for sure is a good case- often you'd be better without. But there are also many good cases where these techniques & knowledge of them is absolutely divine, enables really nice solutions. If you need to instrument some existing 3rd party objects? Fantastic, absolutely fantastic.
- eyelidlessness 6y ago> superiority & certainty I apologize if my certainty came across as superiority. It wasn’t meant that way. I’m certain because of what I’ve learned, and sharing that to hopefully help others shorten that learning process. > this conviction that these language features are never the right answer? I wouldn’t say never. I can think of use cases for it, but they’re all generally around interop with external interfaces that expect this behavior. Even then the example is better served by plain value types, but there are more complex cases where I would use something like this (or a Proxy, or other dynamic dispatch techniques). > In my experience, teams & individuals can have a lot of bad sad mad anecdotes they make for themselves. But other people can find & use the same tools & techniques very stably, successfully, & to good effect. Maybe so. But if I had to guess, I would say that if those teams have a reaction to constructive critique like yours, it’s unlikely they know whether their work is effective or not. > I don't fully believe you, that you have this experience. Okay? Then don’t hire me I guess. I’m not here to prove anything, I was trying to offer a simpler solution and explain its benefits. > That you've earned this ability to trash & insult a rather-wide piece of JavaScript & it's use. In a complete & total way, you've said no, that you alone are the only important voice & that you have total knowledge. This isn't only harsh... it's other unfavorable things too. You’re wildly misinterpreting my comments. I’m not trashing anything. I’m certainly not saying I am alone in expressing anything like this. I stand on the shoulders of giants. The person who first brought the benefit of basic value types instead of dynamic behavior to my attention was a former coworker, who led me to check out Clojure, which improved my work (at least) tenfold. I’ve learned more from paying attention to ML family languages like Elm and Haskell. > Meddling with descriptors is absolutely something that can go wrong, and it's very hard to know it really for sure is a good case- often you'd be better without. But there are also many good cases where these techniques & knowledge of them is absolutely divine, enables really nice solutions. If you need to instrument some existing 3rd party objects? Fantastic, absolutely fantastic. It seems like we might not be as far off in our thinking as you assume. But I think there’s a risk in presenting something like this as a general technique rather than a special case. And I think there’s a benefit in presenting a simpler alternative that would be better for 99% of cases.
- rektide 6y agoI'm fine with alternatives but I didn't feel like any space was left to teach anything but your desired magic bullet that killed this feature dead & I still don't see that you accept limitations or alternatives in your hardline stated views. I wouldn't call object descriptors an unfortunate at all but I think this recent article crystalizes well for me a lot of my instinct, which is that we ought teach & know & learn the hard things, even when we have instincts telling us they are inferior or unsuitable. https://www.executeprogram.com/blog/teaching-the-unfortunate-parts https://www.executeprogram.com/blog/teaching-the-unfortunate... https://news.ycombinator.com/item?id=25564666 https://news.ycombinator.com/item?id=25564666
- afavour 6y agoI’ll admit I’m in the same boat as the OP: overwriting accessors in this way sets off alarm bells internally based on my own past experience of writing code that’s too clever for its own good. But to turn this on its head, can you give an example of the kind of divine, really nice solution you’d get from using this?