Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Break into Reading Open Source

How to Break into Reading Open Source

There's a treasure trove of code that you could learn from hiding in plain sight: Open Source.

By reading other people's code you can pick up new tricks, names, and concepts — and apply them to your code. You can even be exposed to things you'd never think of.

My journey reading Open Source for the hell of it started back in 2013, when I set out to read all of Rails as a Google Summer of Code student.

Join this session to see how I've grown my skills through reading and have the process demystified so you can too. You'll walk away knowing how to start breaking into even the gnarliest codebases.

Kasper Timm Hansen

September 13, 2024
Tweet

More Decks by Kasper Timm Hansen

Other Decks in Programming

Transcript

  1. be a sponge new Ruby syntax – Ruby methods –

    tricks – names – concepts –
  2. you'll be quicker - parsing brand new code - splitting

    it into chunks - picking up new names & concepts - spotting styles & patterns
  3. Running 1 tests in a single process (parallelization threshold is

    50) Run options: --seed 56269 # Running: . Finished in 0.018606s, 53.7461 runs/s, 53.7461 assertions/s. 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
  4. class Reporter < AbstractReporter def record result end end class

    SummaryReporter < Reporter; end # . class StatisticsReporter < Reporter; end # 1 assertions…
  5. audited + actiontext gem "audited" class Post < ApplicationRecord has_rich_text

    :content end ActionText::RichText.audited associated_with: :record
  6. summary we read a bit of YAML ahead-of-time – we

    used that knowledge to debug an issue – we looked at the source of audited and actiontext – we saw that ActionText::Content doesn't support YAML serialization –
  7. what the hell did we just do we learned about

    AOT and JIT reading – we nibbled some rails reading – we became experts at polymorphism from minitest – we used AOT to debug while also doing JIT –