What's a Code Club?
It's like a Book Club, but you read code instead. You can do it remotely (we do it via Google Hangout), or in person. We meet every Sunday at 11AM for one hour of reading.
How do I start my own Code Club?
Great question! First, find some developers to read with. I find it helpful to read with people around my skill level and to keep the group small, about 3 - 5 people. Need help connecting with people? Give a shout @readingcodegood.
Where can I find people to start a Code Club with?
A great place to start is by asking around at local meetups in your area. Organizations focused on learning to program, like Code Crew, Hacker Hours and RailsBridge are also great places to start. If you or your organization are looking to start a Code Club of your own, let us know at @readingcodegood.
What code should I read?
For our group, a code base of about 100 lines (not including gemfiles, config files, specs, etc.) works really well. Any larger, and it becomes too much to get through in an hour. Try a few different sizes in the language you prefer, and see what works for you. To get started, check out the list of Code Bases below. And if you find a different you like, tweet me the link and I'll post it here.
But how do I read it? Should I just read it straight through?
We try to find the main part of the code where most of the action seems to be going on, code usually found in the 'lib' directory, and we read it straight through, generally going line by line. Along the way, we stop a ton for questions, some google searching, discussing things we haven't seen before, calling out patterns we recognize, and testing out new methods as we come across them. And it's in these conversations that the learning really happens.
A different strategy is to start with the specs and find the corresponding code that's being tested. Another is to start with the documentation, and try to find and understand how specific methods work. At the end of the day, these are all just starting points for the real value of Code Club -- the learning that happens in the discussion of the code.
How can I get the most out of Code Club? Any guidelines?
These are great questions you're asking. I'm truly impressed by your inquisitive nature. Here are some guidelines we've used to have some really productive reading sessions.
- Be consistent. For us that means every week, for just one hour.
- Pick a tour guide. It really helps to have someone leading the session. It doesn't mean they're the expert or that they have all the answers. But having a single person to kick things off, make sure everyone's on the same page, and keep the conversation going is really helpful.
- Don't be afraid to digress. Ask lots of questions (How does this method work? Why's that variable called that? What's this module doing here?) and look up the stuff you don't understand along the way. And when you come across something you've never seen before, write some of that code yourself and see what it does! That's the fun part.
- It's a team effort. Everyone should feel comfortable stopping the group, asking questions, and exploring. Having a small group of people (3 - 5) helps make sure everyone's engaged and learning.
- The code doesn't have to be good. We learn a ton from poorly written code. And it's a great opportunity to try and rewrite some of it to make it better. And maybe even make a pull request *gasp*.
- Interact with the code. Reading code is not a passive activity. The literal reading doesn't cut it. Asking questions like "What's the intent of this method?", "Why was it written this way?", and "How does this fit into the overall style and structure of the code base?" are some great starters to making your Code Club session productive and interactive.
- Find knowledge gaps. Code Club is a great way to find gaps in your own programming knowledge, whether the gap is in how a method works, a design pattern, or some higher level programming concept. Use your code reading as a place to find and fill those gaps with your group.
This is great, but I have more questions about reading code. What do I do?
No problem! Tweet me either at @saronyitbarek or @readingcodegood and ask away. Till then, happy reading :)