5.1 Use descriptive names5.1.1 Nondescriptive names make code hard to read5.1.2 Comments are a poor substitute for descriptive names5.1.3 Solution: Make names descriptive5.2 Use comments appropriately5.2.1 Redundant comments can be harmful5.2.2 Comments are a poor substitute for readable code5.2.3 Comments can be great for explaining why code exists5.2.4 Comments can provide useful high-level summaries5.3 Don’t fixate on number of lines of code5.3.1 Avoid succinct but unreadable code5.3.2 Solution: Make code readable, even if it requires more lines5.4 Stick to a consistent coding style5.4.1 An inconsistent coding style can cause confusion5.4.2 Solution: Adopt and follow a style guide5.5 Avoid deeply nesting code5.5.1 Deeply nested code can be hard to read5.5.2 Solution: Restructure to minimize nesting5.5.3 Nesting is often a result of doing too much5.5.4 Solution: Break code into smaller functions5.6 Make function calls readable5.6.1 Arguments can be hard to decipher5.6.2 Solution: Use named arguments5.6.3 Solution: Use descriptive types5.6.4 Sometimes there’s no great solution5.6.5 What about the IDE?5.7 Avoid using unexplained values5.7.1 Unexplained values can be confusing5.7.2 Solution: Use a well-named constant5.7.3 Solution: Use a well-named function5.8 Use anonymous functions appropriately5.8.1 Anonymous functions can be great for small things5.8.2 Anonymous functions can be hard to read5.8.3 Solution: Use named functions instead5.8.4 Large anonymous functions can be problematic5.8.5 Solution: Break large anonymous functions into named functions5.9 Use shiny, new language features appropriately5.9.1 New features can improve code5.9.2 Obscure features can be confusing5.9.3 Use the best tool for the jobSummary