jashkenas / jashkenas/backbone
Aid the reader in understanding the code
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 28.1k
- Forks
- 5.3k
- PR merge metrics
- No merged PRs in 30d
Description
@jdittrich in https://github.com/jashkenas/backbone/issues/4290#issuecomment-2250480128:
I wonder if code readability/learning/extending could be a focus in an update? That is not limited to code itself but also to documentation. It would not be a strong departure (though I find the event handling code difficult to understand sometimes) and might entail some potential compromizes where ease-of-understanding might be favored over performance, as well as architectural documentation (something between the line comments and the current documentation)
Me in https://github.com/jashkenas/backbone/issues/4290#issuecomment-2250776180:
Could you elaborate a bit on how you would like to see this intermediate documentation?
@jdittrich in https://github.com/jashkenas/backbone/issues/4290#issuecomment-2250875377:
intermediate documentation
…for me would usually involve
What is already in "getting started"
And then, for the larger code modules how to read and understand the respective code. For event handling (since that is the part that I know best) something like: What are the contracts/interfaces for an
__Api-Function/Reducer, how isthis._eventsstructured, which "private" attributes are added to an object that uses the Events mixin (These are all focussed on the current way events work)JSDoc might help with the contracts/interfaces?
Basically, something that helps understanding how different parts of the code work together and how to read the code.
I suspect it would already help a lot if there were diagrams that visualize the relations between the different parts of the code. Those could be included right inside the Docco annotated source, because it supports Markdown inside the comments.
Comments welcome, as well as pull requests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Getting Started guide and the Docco annotated source at backbonejs.org/docs/backbone.html, then review the event-handling code and its existing comments. Define which code relationships, Events contracts, and private attributes need explanation before choosing diagrams, JSDoc, or architectural documentation. Done should mean contributors can understand how the major modules work together and how to navigate the event system.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100