-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More examples and motivations #17
Comments
As merely an interested observer, I can say that it has two really helpful use cases (which I could write up more formally and submit a PR if someone wants):
|
It also helps remove problems like the ones in https://twitter.com/jasnell/status/913794961958510592 where a string based interface system was poisoning the ecosystem. |
What problems does having protocols solve? I'm not sure I understand the question. Clojure uses them. I wanted them so badly in JavaScript that I implemented them, for all the same reasons Clojure did, and have been using them happily for going on a decade. I'd be thrilled if this made it into JavaScript proper where it could be implemented for performance. The most compelling use cases Clojure describes. It allows you to use the same set of functions for manipulating data structures without always caring about the precise data structure you're dealing with. That is, the decisions about performance and behavior for something are made at an earlier point of execution, and later the program performs its routine work using canned functions and not caring about concrete types, only abstractions. Having been using them for years, it's been a real boon. |
I'm still struggling what problems this solves, can you help me enumerating some of the most compelling use cases this enables? You mentioned iter-ables/then-ables but this being a userland affordance, what are the most promising things you think this will enable? Is there an application for constructing/manipulating the DOM? Is there an application for collections? What are the most compelling problems this is addressing? And for each example, articulate clearly how this proposal helps (as opposed to without it)?
The text was updated successfully, but these errors were encountered: