Open titoBouzout opened 6 months ago
IMO this is bikeshedding
You think? To me the API surface is very important. Code reads more clearly with read/write than with get/set. Is not the typical get/set, both actions have side effects reading and writing communicates the difference properly. Also, you comment adds nothing of value. If you are not interested do something else.
Sorry, I did not mean for it to be a throw-away comment. I agree the API surface area and names in general are not bikeshedding.
I personally, coincidentally, find get and set more clear, because read and write are usually associated with cold storage in my experience. I don't think either get/set or read/write indicate side effects. If anything pull/push might indicate side effects more and aligns with the terminology of the design.
I'm only one vote and these things are about feedback/consensus. My estimate is the average user isn't going to find push/pull or get/set or read/write notable. But they will find stuff like not working with Async notable.
It's good you brought up the topic, I've said my piece, now it's up to others to say theirs so we can have a complete picture.
get()
is commonly associated with getting a value by name/key in web APIs (Map.prototype.get(key), FormData.prototype.get(name), URLSearchParams.prototype.get(name), etc.), so get()
without passing a argument looks weird to me.
That's it. This may be subjective, but I believe It makes it easier to reason about things when you refer to
reading
andwriting
thangetting
andsetting
.getter
executes a method and aread
returns a value.I could probably make the point stronger by copy pasting snippets from this very same repo that includes the wording read and write:
Link to "reads" of this repo https://github.com/search?q=repo%3Atc39%2Fproposal-signals+reads&type=issues Link to "writes" of this repo https://github.com/search?q=repo%3Atc39%2Fproposal-signals+writes&type=issues