- YAGNI: Don't build it until you need it.
- DRY: Extract patterns after second duplication, not before.
- Fail Fast: Explicit errors beat silent failures.
- Simple First: Write the obvious solution, optimize only if needed.
- Delete Aggressively: Less code = fewer bugs.
- Semantic Naming: Always name variables, parameters, and API endpoints with verbose, self-documenting names that optimize for comprehension by both humans and LLMs, not brevity (e.g.,
waitUntilObjectIsSaved = truevswait = true). - Naming the app in identifiers: spell it out as
Batterby/batterbyin code — variables, constants, config values, storage keys. The shortbtb/BTB_form is only for identifiers that are also read outside this codebase and benefit from being terse: DOM ids and classes in the browser extension, Blender object prefixes, and generated filenames.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| module.exports = function CustomError(message, extra) { | |
| Error.captureStackTrace(this, this.constructor); | |
| this.name = this.constructor.name; | |
| this.message = message; | |
| this.extra = extra; | |
| }; | |
| require('util').inherits(module.exports, Error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |