| OLD | NEW |
| 1 Design Principles | 1 Design Principles |
| 2 ================= | 2 ================= |
| 3 | 3 |
| 4 * There should be no objects that represent live state that reflects | 4 * There should be no objects that represent live state that reflects |
| 5 some other state, since they are expensive to maintain. e.g. no | 5 some other state, since they are expensive to maintain. e.g. no |
| 6 HTMLCollection. | 6 HTMLCollection. |
| 7 | 7 |
| 8 * Property getters should be efficient. If an operation is inefficient | 8 * Property getters should be efficient. If an operation is inefficient |
| 9 it should be a method instead. e.g. document.getForms(), not | 9 it should be a method instead. e.g. document.getForms(), not |
| 10 document.forms. | 10 document.forms. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 * APIs that encourage bad practices should not exist. e.g., no | 24 * APIs that encourage bad practices should not exist. e.g., no |
| 25 document.write(), innerHTML, insertAdjacentHTML(), etc. | 25 document.write(), innerHTML, insertAdjacentHTML(), etc. |
| 26 | 26 |
| 27 * If we expose some aspect of a mojo service (e.g. touch events) we | 27 * If we expose some aspect of a mojo service (e.g. touch events) we |
| 28 should expose/wrap all of it (e.g. mousewheel) so that there's no | 28 should expose/wrap all of it (e.g. mousewheel) so that there's no |
| 29 cognitive cliff when interacting with that service | 29 cognitive cliff when interacting with that service |
| 30 | 30 |
| 31 * APIs should always spell acronyms like words (findId, not findID; | 31 * APIs should always spell acronyms like words (findId, not findID; |
| 32 XmlHttpRequest, not XMLHttpRequest) | 32 XmlHttpRequest, not XMLHttpRequest) |
| 33 |
| 34 * If we extend a method to have new arguments, they must be optional |
| 35 if there's any content using the existing method. |
| OLD | NEW |