Ticket #4580 (assigned enhancement)
[meta] Consistency In API
| Reported by: | ptwobrussell | Owned by: | alex |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | General | Version: | 0.9 |
| Severity: | normal | Keywords: | api, consistency |
| Cc: | ptwobrussell@… |
Description
From ptwobrussell:
As I'm writing this book on Dojo, I'm looking at the totality of the toolkit from an API-centric point of view (especially Base) and am noticing (fairly minor) inconsistencies that we may want to consider "fixing". For example:
- In html.js, most functions from this family accept either a string id or a dom node as a first param, but a few (like hasClass, addClass, etc.) accept only a dom node and fail if you accidentally (because you're generalizing your knowledge from other functions) pass in an id value. So there's the size (extra dojo.byId call) vs consistency vs performance vs breakage considerations in dealing with fixing something like this.
- In other places, params to families of functions are named different things, so it would be nice to name params consistently across the board so that the "family" relationship might be even more apparent, so that your doc tools produce a nice consistent API, etc. (things like obj vs thisObject vs o as param names, for example.)
In either of these cases, I'd be happy to generate the patches since I'm _almost_ generating them anyway as I sift through all of these things in my writing efforts. However, in that first issue especially, it seems as though there would need to be a little pow-wow to get to some final decision.
Change History
Note: See
TracTickets for help on using
tickets.