Functions¶
Status: ⏳ PENDING
The inverse of this chapter's rules — practices to recognize and avoid. Each will get a junior-level definition, a real example of the harm it causes, and the clean alternative.
Anti-Patterns to Cover¶
- Flag arguments (
render(true)vsrenderHtml()/renderText()) - Output arguments (mutated parameters instead of return values)
- Hidden temporal coupling (caller must invoke
a()beforeb()) - Mixed levels of abstraction in one function
- Returning
nullinstead of empty collection / Optional / Result - Functions over ~20 lines with no clear sub-step boundary
See the chapter README for the positive rules.