-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Best Practices for Writing Code
Andrew Wooldridge edited this page May 2, 2013
·
10 revisions
Get into the habit of running git diff
or git diff --cached
before every commit.
You should keep each commit as granular as possible. For instance, do not check in 2 bug fixes in one commit -- separate them out into 2 commits.
The team has decreed there will be no tabs in our code. Please set your tabs to equal 4 spaces.
innerHTML
and Y.Node.setContent()
pass data to innerHTML under the hood, which may lead developers to inadvertently write unsafe code on top of our APIs. Do not use these methods unless you actually need their functionality. If all you need to do is put some plain text on the page, use Y.Node's text
attribute which is safe for user-supplied strings:
2