http://video.google.com/videoplay?docid=-474821803269194441
jQuery is very popular library. Maybe someday i should look through it.
How to write a good library?
-
write a solid api ( made a grid, filled in the blanks)
-
Fear Adding Methods ( Methods can cause a support nightmare; avoid adding, if you can; defer to extensibility)
-
Embrace Removing code
-
Provide an Upgrade path
-
Reduce to a common root
-
Consistency
-
naming scheme and stick with it
-
argument position (options, arg2, … , callback)
-
Callback context.
-
-
Namespacing (Questios to ask)
-
Can my code coexist with other random code on the site?
-
Can my code coexist with other copies of my own library?
-
Can my code be embedded inside another namespace?
-
-
Perform Type Checking
-
Make your API more fault resistant
-
Correct values whenever possible
-
Error message
-
-
Errors
-
Never gobble errors
-
Ignore the templation to try { … } catch(e) {}
-
Improves debug-ability for everyone [weil: Mike burrows give the same suggestion, he said we should give a assert violation as earlier as we can.]
-
-
Extensibility
-
Your code should be easily extensible
-
Write less, defer to others
-
Makes for cleaner code
-
Foster community and growth
-
-
Documentation
-
structured (provide a clear format, users can build new views with it, An API for your API!)
-
Users want to help
-
Make barries to helping very low
-
Keep your docs in a wiki
-
Only do this if you’ve already written all of your doces
-
Use template to maintain structure.
-
-
Write the Docs Yourself
-
It isn’t glamorous, but it’s essential
-
You must buckle-down and do it yourself
-
Improves your longevity
-
-
-
Tesiting (1000% Essential)
-
Test-driven development
-
wirte test cases before your tackle the bugs
-
find devs who love to write test cases
-
check for failures before commit
-
-
-
Maintain Focus
-
very very important
-