← Graph

Code Golfing in Ruby Lightning Talk

talk 7 connections

Lightning talk by the Poznań Ruby Community organizer at wroclove.rb 2023. Introduces Advent of Code (annual December puzzle event, easy at first, then gets harder so people drop off; huge community, memes, discussion of quests and solutions). Defines code golfing — solving problems with the shortest possible source code, counting characters/bytes. Notes dedicated golf languages (Golf Script as a Ruby macro language; various cryptic base-64 / compiled languages) exist specifically to shrink programs. Walks through an Advent of Code input-parsing example, first with a trivial solution and then shrunk to ~100 characters using eval on strings, stripping spaces and hacking whitespace-sensitive spots. Lessons learned from golfing: deep dive into the language itself; Ruby's `$`-prefixed global variables are useful for script file parsing; shorter code is NOT easier to understand; Ruby supports recursive arrays (rendered in inspect as `[...]`). Ends recommending Ruby code-golf tips online.

type
lightning-talk
talk Code Golfing in Ruby Lightning Talk
about
Uses an Advent of Code parsing puzzle as the golf example
talk Code Golfing in Ruby Lightning Talk
about
Ruby tool
Demonstrates Ruby features exposed by aggressive code golf
talk Code Golfing in Ruby Lightning Talk
about
Cites Golf Script as a Ruby-macro language specialized for code golf
talk Code Golfing in Ruby Lightning Talk
about
Speaker opens by inviting the audience to the Poznań Ruby Community
talk Code Golfing in Ruby Lightning Talk
about
RuboCop tool
Mentions RuboCop ('ruboko') as a tool that can make golfed code slightly better
from_talk
Code Golfing in Ruby Lightning Talk talk
Key lesson learned from golfing Advent of Code problems
talk Code Golfing in Ruby Lightning Talk
presented_at
Presented in the wroclove.rb 2023 lightning-talk session

Provenance

Created in
wroclove.rb 2023 Lightning Talks 2026-04-17 22:11
Read by
11 extractions