The Epic Groovy Puzzlers S02: The Revenge of the Parentheses
summary
A rapid demo of Groovy gotchas that shows exactly when code surprises: parentheses change whether interpolation produces a GString or a plain String and so change runtime behavior, list literals vs array literals copy or alias unexpectedly, using collect on an empty optional returns an empty list rather than throwing, and == can call equals or identity depending on types. Includes code snippets, reproduction steps, and fixes (add parentheses or explicit casts) with live examples that fail and then work. parentheses change GString vs String interpolation collect on empty returns empty list not NPE
AI-written summary · about
chapters (25)
- 0:00Introduction
- 3:17Quiz rules and format
- 5:24Puzzle 1: Alphabet and parentheses
- 8:03Puzzle 2: Parentheses impact
- 9:32Puzzle 3: Variables and strings
- 10:16Puzzle 4: Variable mutation
- 12:53Puzzle 5: String templates
- 13:36Puzzle 6: Number 666
- 14:53Puzzle 7: Methods and extensions
- 16:28Puzzle 8: Unicode encoding
- 17:38Puzzle 9: Inheritance and constructors
- 18:44Puzzle 10: Answer options
- 20:11Puzzle 11: Groovy instructions
- 20:55Puzzle 12: Lists and strings
- 21:59Puzzle 13: Initialization
- 23:00Puzzle 14: Compile errors
- 24:02Puzzle 15: collect method
- 25:51Puzzle 16: Variables and loops
- 26:59Puzzle 17: Exceptions and types
- 28:26Puzzle 18: Chunk and modifications
- 30:16Puzzle 19: Cursors and checks
- 32:06Puzzle 20: Templates and errors
- 32:48Puzzle 21: assert method
- 33:58Puzzle 22: Comparison operators
- 35:25Conclusion
related talks
57mThe Epic Groovy Puzzlers S02: The revenge of the parentheses
01h 31mGroovy and Grails Puzzlers - As usual - Traps, Pitfalls, and End Cases
01h 00mGroovy Puzzlers — Strange, Unclear, and "Mom, What Is That?!"
57mJava Puzzlers S03
56mGroovy Puzzlers S03 – Groove Like a Groovemaker!
50mModern Java Puzzlers
49mJava Collections Puzzlers
54mJava Puzzlers NG: The strange, the bizarre, and the wonderful
