Code Golf: The zen of writing bad code II
summary
Walks through concrete PowerShell code golf: using the code.golf web runner (PowerShell 7), shaving whitespace and aliases, replacing if chains with ternary and null‑coalescing, and abusing scriptblocks, string multiplication, deconstruction, regex match and hash lookups. Shows a FizzBuzz reduction 287→42 characters and an arrows solution trimmed to ~155 (leaderboard at 66), plus a 12‑Days version at ~424 — all validated on the site and iterated until the output matches the tests.
AI-written summary · about
chapters (9)
- 0:00Code golf introduction
- 8:43Trimming whitespace
- 15:29Arrays and strings
- 18:45PowerShell deconstruction
- 25:22Looping techniques
- 33:27FizzBuzz challenge
- 56:49Arrows challenge walkthrough
- 1:12:5012 Days of Christmas
- 1:22:05Final reflections
related talks
46mCode Golf: The zen of writing bad code
49mCode Golf - The Zen of Writing bad Code
40mCode Writing Code, say what now! Meta Programming and PowerShell
12mWhy Less Code Isn’t Always Better
01h 37mMore Game Breaking PowerShell
32mFive Lines of Code
35mFive Lines of Codes
40mLessons from two decades of writing bad code
