API method names
See original GitHub issueHey there!
I am coming to the Choo universe (chooniverse?) from React and so far I like the lighter-weight approach. There were some confusing things about the Nanocomponent API that held me up a bit. I’m curious about the reasoning behind the API method names.
- Why isn’t
update()
called something likeshouldUpdate()
? As a user, I would expect the component to re-render if I callthis.update()
- Why are the lifecycle methods all lowercase, but don’t use the
on
prefix? Is there a precedent for this? Same issue as above, where I would expectload()
andunload()
to do something different. Maybe it would make more sense to usemount
/unmount
since those terms are used elsewhere in the Choo documentation?
These questions may have simple answers but they weren’t obvious to me. Thanks for all your work!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Naming conventions | Cloud APIs
Names used in APIs should be in correct American English. · Commonly accepted short forms or abbreviations of long words may be used...
Read more >Best Practices for Naming REST API Endpoints
Best Practices for Naming REST API Endpoints · Use Nouns to Name URIs · Use Clear, Unabridged Names That Are Intuitive · Use...
Read more >10 Best Practices for Naming REST API Endpoints
10 Best Practices for Naming REST API Endpoints · 1. Use Nouns · 2. Use Intuitive, Clear Names · 3. Use Lowercase Letters...
Read more >REST API - URL Naming Conventions
In REST, having a strong and consistent REST resource naming strategy – will prove one of the best design decisions in the long...
Read more >REST API Naming Conventions and Best Practices
REST API Naming Conventions and Best Practices · Use Nouns to represent resources / Not Verbs · Use Pluralized Nouns for resources ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Going to close this since changing method names in a future major release isn’t on the roadmap for now. Open to making this a priority if enough people feel it’s important.
Putting this issue to bed for now 🛌😴
Hi @blahah – I believe generally the idea was to follow existing conventions from the DOM spec. So
createElement
comes fromdocument.createElement()