Playing Well With Others – Writing Solid Code in Large Community Projects
summary
Large community projects succeed when code assumes other people will read and reuse it: treat input conservatively, validate type and range, and make failures explicit — prefer return a single type instead of sometimes-null or mixed values. Calls out WordPress examples like get_post and wp_insert_post; recommends using PHP list() to return (post_id, has_error boolean), run static analysis, keep comments that explain non‑obvious choices and data shapes, and blow up early so bugs surface quickly.
AI-written summary · about
chapters (20)
- 0:00Start
- 0:41THE SECRET
- 2:53EDGE CASES
- 4:29BOUNDARY CONDITIONS
- 5:21INPUT IS AGGRESSIVE
- 8:00LIBERAL INPUT
- 9:19CONSERVATIVE INPUT
- 10:44ESCHEW OBFUSCATION
- 11:37RETURN A LEGITIMATE VALUE
- 12:44RETURN A SINGLE TYPE
- 13:41FAILURE MODES?
- 15:20FILL IN THE GAPS
- 16:50DESCRIBE HOW IT COULD HAVE BEEN
- 18:29DESCRIBE ABNORMALITIES
- 19:13POINT OUT RISKS
- 20:32TRIVIALIZE TRIVIA
- 25:49WHEN YOU JUST GOTTA
- 26:02A SNEAKY ALGORITHM
- 26:31DUAL ALGORITHMS FOR DEV WORK
- 26:46DUAL ALGORITHMS FOR LIVE TESTS
