Code Golf - The Zen of Writing bad Code
summary
Live demo of concrete PowerShell tricks and the final score not rhetoric shows how to shrink real solutions on code.golf, using PowerShell 7 features and shell aliases to cut characters, replacing functions with scriptblock recursion, exploiting n++/++n behavior and pipeline assignment, and using numeric literal formats to win with a 47-character Collatz solution. Slides and terminal examples run on the code.golf site so code executes, errors appear, and the published recording is captured by Confreaks for replay.
AI-written summary · about
chapters (19)
- 0:00Welcome
- 1:15Code golf for PowerShell
- 3:06Shrinking PowerShell code
- 10:14String and array tricks
- 12:47Variable hacks
- 15:33Assignment tricks
- 19:45Ternary operator
- 23:18Looping techniques
- 26:52PowerShell aliases
- 29:01Collatz conjecture
- 31:10Challenge with function
- 34:42Remove function
- 36:30Optimize loop logic
- 38:58Recursion for golf
- 41:49Nested ternaries
- 44:43Eliminating parameter blocks and extra syntax
- 46:27Final optimizations
- 47:32Community solutions
- 48:15Closing
related talks
01h 28mCode Golf: The zen of writing bad code II
46mCode Golf: The zen of writing bad code
40mCode Writing Code, say what now! Meta Programming and PowerShell
01h 37mMore Game Breaking PowerShell
12mWhy Less Code Isn’t Always Better
01h 45mWriting Award Winning PowerShell Functions and Script Modules
01h 18mKeynote: Refactoring Superpowers: Make Your IDE Do Your Work, Faster and More Safely
40mLessons from two decades of writing bad code
