111
That’s not my code! @MicheleTitolo Thursday, May 15, 14

That's Not My Code!

Embed Size (px)

DESCRIPTION

Inheriting code is something we all have to deal with, and knowing what you're getting yourself into is a big part of that initial deep dive. Just like anything else, this is a skill that needs to be practiced and perfected over time. This session will walk through some strategies to use when looking at code you didn't write, finding problem spots, as well as share some personal experiences I've had when working with other people's code. You'll leave feeling confident about digging into your next codebase, and have some new tools in your pocket for dealing with the unexpected.

Citation preview

Page 1: That's Not My Code!

That’s not my code!@MicheleTitolo

Thursday, May 15, 14

Page 2: That's Not My Code!

Thursday, May 15, 14

Page 3: That's Not My Code!

Thursday, May 15, 14

Page 4: That's Not My Code!

Thursday, May 15, 14

Page 5: That's Not My Code!

Thursday, May 15, 14

Page 6: That's Not My Code!

Thursday, May 15, 14

Page 7: That's Not My Code!

The Art of Code

Thursday, May 15, 14

Page 8: That's Not My Code!

Purpose

Thursday, May 15, 14

Page 9: That's Not My Code!

What are you trying to solve?

Thursday, May 15, 14

Page 10: That's Not My Code!

Fixing a bug?

Thursday, May 15, 14

Page 11: That's Not My Code!

Adding a new feature?

Thursday, May 15, 14

Page 12: That's Not My Code!

Updating a web API?

Thursday, May 15, 14

Page 13: That's Not My Code!

This helps focus your search

Thursday, May 15, 14

Page 14: That's Not My Code!

First thing’s first.

Thursday, May 15, 14

Page 15: That's Not My Code!

Does it build?

Thursday, May 15, 14

Page 16: That's Not My Code!

No! Wait!

Thursday, May 15, 14

Page 17: That's Not My Code!

You can and will learn a lot before building

Thursday, May 15, 14

Page 18: That's Not My Code!

Meta Information

Thursday, May 15, 14

Page 19: That's Not My Code!

Who? What? When? Where?

Thursday, May 15, 14

Page 20: That's Not My Code!

Why? How?

Thursday, May 15, 14

Page 21: That's Not My Code!

Who? What? When? Where?

Thursday, May 15, 14

Page 22: That's Not My Code!

Who?

Thursday, May 15, 14

Page 23: That's Not My Code!

Source Control

Thursday, May 15, 14

Page 24: That's Not My Code!

git log

Thursday, May 15, 14

Page 25: That's Not My Code!

Or use a GUI

Thursday, May 15, 14

Page 26: That's Not My Code!

How many people?

Thursday, May 15, 14

Page 27: That's Not My Code!

Are all the commits by one user?

Thursday, May 15, 14

Page 28: That's Not My Code!

Are the commit messages useful?

Thursday, May 15, 14

Page 29: That's Not My Code!

Xcode File Headers

Thursday, May 15, 14

Page 30: That's Not My Code!

//// MRTViewController.m// Awesome App//// Created by Michele Titolo on 5/03/14.// Copyright (c) 2014 Awesome Co. All rights reserved.//

Thursday, May 15, 14

Page 31: That's Not My Code!

Find in Project

Thursday, May 15, 14

Page 32: That's Not My Code!

grep

Thursday, May 15, 14

Page 33: That's Not My Code!

Were the files mostly created by one person?

Thursday, May 15, 14

Page 34: That's Not My Code!

Were they created by 17 people?

Thursday, May 15, 14

Page 35: That's Not My Code!

Too many cooks in the kitchen

Thursday, May 15, 14

Page 36: That's Not My Code!

Common encounters

Thursday, May 15, 14

Page 37: That's Not My Code!

One shop, two shopred shop, blue shop

Thursday, May 15, 14

Page 38: That's Not My Code!

Bifurcated code

Thursday, May 15, 14

Page 39: That's Not My Code!

No source control?No names in headers?

Thursday, May 15, 14

Page 40: That's Not My Code!

This tells you about the client

Thursday, May 15, 14

Page 41: That's Not My Code!

What?

Thursday, May 15, 14

Page 42: That's Not My Code!

Use the app

Thursday, May 15, 14

Page 43: That's Not My Code!

There will be things you don’t understand until you use it.

Thursday, May 15, 14

Page 44: That's Not My Code!

Thursday, May 15, 14

Page 45: That's Not My Code!

Use the app

Thursday, May 15, 14

Page 46: That's Not My Code!

Ask questions

Thursday, May 15, 14

Page 47: That's Not My Code!

Identify edge cases

Thursday, May 15, 14

Page 48: That's Not My Code!

...because you will have to deal with them

Thursday, May 15, 14

Page 49: That's Not My Code!

Oh, and write all of this down

Thursday, May 15, 14

Page 50: That's Not My Code!

Future you will thank you

Thursday, May 15, 14

Page 51: That's Not My Code!

When?

Thursday, May 15, 14

Page 52: That's Not My Code!

What iOS version?

Thursday, May 15, 14

Page 53: That's Not My Code!

What version was it built for?

Thursday, May 15, 14

Page 54: That's Not My Code!

Updating iOS 4 apps is a PITA

Thursday, May 15, 14

Page 55: That's Not My Code!

Backwards compatibility?

Thursday, May 15, 14

Page 56: That's Not My Code!

Is it using new stuff?

Thursday, May 15, 14

Page 57: That's Not My Code!

How is it checking version?

Thursday, May 15, 14

Page 58: That's Not My Code!

The further back, the more fragile the code will be

Thursday, May 15, 14

Page 59: That's Not My Code!

Gaps in development?

Thursday, May 15, 14

Page 60: That's Not My Code!

If it went months untouched, why?

Thursday, May 15, 14

Page 61: That's Not My Code!

Years?

Thursday, May 15, 14

Page 62: That's Not My Code!

Technical Debt

Thursday, May 15, 14

Page 63: That's Not My Code!

Where?

Thursday, May 15, 14

Page 64: That's Not My Code!

Contractors? In-House? Shop?

Thursday, May 15, 14

Page 65: That's Not My Code!

In-house -> out-of-house

Thursday, May 15, 14

Page 66: That's Not My Code!

Contractors - who?

Thursday, May 15, 14

Page 67: That's Not My Code!

Dev Shops

Thursday, May 15, 14

Page 68: That's Not My Code!

Outsourced?

Thursday, May 15, 14

Page 69: That's Not My Code!

Not written by someone who’s native language is yours

Thursday, May 15, 14

Page 70: That's Not My Code!

i.e. “colour” vs “color”

Thursday, May 15, 14

Page 71: That's Not My Code!

iOS Experience?

Thursday, May 15, 14

Page 72: That's Not My Code!

Internationalization

Thursday, May 15, 14

Page 73: That's Not My Code!

What countries is the app available?

Thursday, May 15, 14

Page 74: That's Not My Code!

What languages are supported?

Thursday, May 15, 14

Page 75: That's Not My Code!

The Code

Thursday, May 15, 14

Page 76: That's Not My Code!

The fun part!

Thursday, May 15, 14

Page 77: That's Not My Code!

Why?

Thursday, May 15, 14

Page 78: That's Not My Code!

Who, What, When, Where

Thursday, May 15, 14

Page 79: That's Not My Code!

Just don’t jump to conclusions

Thursday, May 15, 14

Page 80: That's Not My Code!

How?

Thursday, May 15, 14

Page 81: That's Not My Code!

File Structure

Thursday, May 15, 14

Page 82: That's Not My Code!

Xcode vs HD

Thursday, May 15, 14

Page 83: That's Not My Code!

Images

Thursday, May 15, 14

Page 84: That's Not My Code!

Make a map of where everything is

Thursday, May 15, 14

Page 85: That's Not My Code!

Building

Thursday, May 15, 14

Page 86: That's Not My Code!

Does it compile?

Thursday, May 15, 14

Page 87: That's Not My Code!

...because it doesn’t always

Thursday, May 15, 14

Page 88: That's Not My Code!

Missing dependencies?

Thursday, May 15, 14

Page 89: That's Not My Code!

Weird build settings?

Thursday, May 15, 14

Page 90: That's Not My Code!

Warnings

Thursday, May 15, 14

Page 91: That's Not My Code!

Number

Thursday, May 15, 14

Page 92: That's Not My Code!

Severity

Thursday, May 15, 14

Page 93: That's Not My Code!

#warning

Thursday, May 15, 14

Page 94: That's Not My Code!

Comments

Thursday, May 15, 14

Page 95: That's Not My Code!

TODO, FIXME, ???, $#^@!

Thursday, May 15, 14

Page 96: That's Not My Code!

Documentation?

Thursday, May 15, 14

Page 97: That's Not My Code!

Headers

Thursday, May 15, 14

Page 98: That's Not My Code!

README

Thursday, May 15, 14

Page 99: That's Not My Code!

The .pch

Thursday, May 15, 14

Page 100: That's Not My Code!

Tests

Thursday, May 15, 14

Page 101: That's Not My Code!

Dependencies

Thursday, May 15, 14

Page 102: That's Not My Code!

Submodules

Thursday, May 15, 14

Page 103: That's Not My Code!

CocoaPods

Thursday, May 15, 14

Page 104: That's Not My Code!

???

Thursday, May 15, 14

Page 105: That's Not My Code!

The Art of Code

Thursday, May 15, 14

Page 106: That's Not My Code!

Who, What, Where, When, Why, How

Thursday, May 15, 14

Page 107: That's Not My Code!

Art takes time

Thursday, May 15, 14

Page 108: That's Not My Code!

Art takes patience

Thursday, May 15, 14

Page 109: That's Not My Code!

Code takes time

Thursday, May 15, 14

Page 110: That's Not My Code!

Code takes patience

Thursday, May 15, 14

Page 111: That's Not My Code!

Thanks!@MicheleTitolo

Thursday, May 15, 14