1) The document discusses achieving maintainability in code through analysis, automation, and enforcement of standards.
2) It recommends setting up linting, code coverage, and other analysis tools to examine code quality and automatically enforcing code style through build processes.
3) The key is to automate as many processes as possible like testing, linting, and documentation to make the code easy to work with and prevent issues from being introduced.
24. KNOW YOUR LINTERS
JSHINT
ESLINT
JSCS
Community-driven JSLint fork. High configurability.
JSHint alternative. High configurability.
Code style checker. Separate and complementary.
WHAT ABOUT JSLINT AND CLOSURE LINTER?
35. function main(a) {
if (a) {
} else if (a) {
}
!
if (other) { }
!
for (var i = 0; i < a; i++) {
if (i % 2) {
} else if (i % 3) {
}
}
}
COMPLEXITY : 7
64. ‣ Code style
‣ Metrics
‣ Build tools
‣ Data formats
‣ Naming conventions
‣ Curly Braces
‣ Directory structure
‣ Everything
ENFORCE
‣ Automate Everything
‣ VCS hooks
‣ CI
‣ Code reviews
‣ Reports
‣ Everything
‣ Warnings === errors
‣ Make it hard to be
wrong
DOCUMENT
‣ Treat docs as code
‣ Make it
‣ easy to find
‣ easy to read
‣ easy to update
‣ easy to discuss
‣ Use github!
AGREE
GET EVERYONE TOGETHER