how to get started in a new codebase

26
Getting started in a new codebase Or, How to Learn Lots of New Swears

Upload: rachel-sanders

Post on 22-Jul-2015

384 views

Category:

Technology


0 download

TRANSCRIPT

Getting started in a new codebase

Or, How to Learn Lots of New Swears

About me

1. How do you walk in and kick ass in a new codebase?

2. How do you make code that'seasy for others to learn?

This Takes TimeMost companies expect a 2-3 month rampup

Part 1: Know Your Foe

Give yourself the best codebase possible. Ask questions before you start the job.

Quite reasonable things to ask in a interview

What kind of [vcs, workflow] do you use?

How often do you deploy code?

What do you wish was better about your codebase?

What would I do in my first week, month?

****, now what?

Step 2: Learn the Theory

Get a 30,000' view

What does this code do from a business standpoint?

Who uses it? How?

What's known about it?

Gather all documentation that you can find and read it.

It's probably lies but it's comforting and it makes you look

like you're doing something.

Start a vocabulary sheet

Code evolves. Design evolves.

Concepts rarely do.

Talk to a human

So the codebase is Java, C, PHP and Haskell. Yeah, I don't know either.

During a code walkthrough

Get an overview of the code structure and evolution

Populate your vocabulary sheet

Know what patterns are being used + learn them

Know where the ugly and the scary parts are

Get the test suite running

Be sure to update the Getting Started Doc so there are fewer lies in it.

Step 3: Start Digging

Get a bug to fix

Most companies will start you out on one. Open source: see if any are tagged or ask on IRC.

DO NOT STRUGGLE. Give yourself a time limit and then ask for help.

People expect you to be slow & confused. Take advantage of this.

Stop and smell the code paths

What are the folders and entry points?

What are the high-level components?

What third party libraries does it use?

Where is the configuration?

Make and test assumptions

Do your assumptions hold? If not, why? Notice when you're confused.

Good code is...

You can make assumptions and usually be right

You don't have to understand all of the code to understand part of the code

Clarity trumps correctness

–Joel Spolsky

"It’s harder to read code than to write it."

Code is not magic.

Be bold about making things better. You own it now.

Questions?

Rachel Sanders @trustrachel

More Resources

A Process for Learning a New Codebase

Attributions

https://www.flickr.com/photos/adamskev/1414073283

https://www.flickr.com/photos/alc_chris/8887270072/

https://www.flickr.com/photos/goodsardine-clean/543506410/

https://www.flickr.com/photos/thevlue/5228406300

https://www.flickr.com/photos/broadbeanmedia/8103976340/

Attributions

https://www.flickr.com/photos/viejozapato/2691485099/

https://www.flickr.com/photos/69125796@N00/7420991330/

https://www.flickr.com/photos/owly/2511317066/

https://www.flickr.com/photos/26499572@N08/5028769858/

https://www.flickr.com/photos/deniscollette/2341238645/