Appendices
A
Glossary
Tidy design principles
Welcome
Unifying principles
Implementation
Names attribute
Name all but the most important arguments
Function names
Scannable specs
Make inputs explicit
Put the most important arguments first
Required args shouldn’t have defaults
Put
…
after required arguments
Keep defaults short and sweet
Enumerate possible options
Reduce argument clutter with an options object
Argument meaning should be independent
Strategies
Prefer a enum, even if only two choices
Extract strategies into objects
Three functions in a trench coat
Case study:
rep()
Implicit strategies
Case study:
html_element()
The I()dentity strategy
Function arguments
Avoid magical defaults
Explain important defaults
User settable defaults
Making data with …
Dot prefix
Inspect the dots
Case study:
mapply()
vs
pmap()
Case study:
setNames()
Outputs
Returning multiple values
Type-stability
Vectorisation
Side-effect functions should return invisibly
Evolution
Work with multiple dependency versions
Side effects
Side-effect soup
Spooky action
Errors
Error call
Error constructors
Appendices
Glossary
Appendix A — Glossary
Error constructors