Suggestions and tips for exploring a brand new codebase – Donny Wals


As a developer, becoming a member of a brand new venture or firm is usually a frightening and scary activity. You must get aquatinted with not only a entire new workforce of individuals, however you additionally must familiarize your self with a completely new codebase that may use new naming conventions, follows patterns that you just’re not acquainted with, and even makes use of tooling that you just’ve by no means seen earlier than.

There are many causes to be overwhelmed whenever you’re a brand new member of any engineering workforce, and there’s no purpose to really feel dangerous about that.

Previously two years, I’ve carried out a number of contracting and consulting which implies that I’ve needed to discover and perceive a lot of codebases in brief quantities of time. Typically even having to discover a number of codebases without delay each time I’d begin to work for multiple shopper in a given week or two.

I assume it is honest to say that I’ve had my fair proportion of confusion and feeling overwhelmed with new codebases.

On this put up, I’d wish to offer you some suggestions and tips that I take advantage of to get myself comfy with codebases of any measurement in an affordable period of time.

Meet the workforce

Whereas it may be tempting to get by your introductory calls as quickly as doable so you may spend as a lot time as doable on navigating and exploring a brand new codebase, I extremely suggest letting the code look ahead to a short while. Meet the workforce first.

Attending to know the those that wrote the code that you just’re working with can actually assist to construct a greater understanding of the codebase as an entire. Ask questions on workforce dynamics, and ongoing initiatives, who’s an professional on what? Constructing empathy across the code you’ll be working with is a really helpful software.

Understanding which workforce members know most about particular options, elements of the codebase, instruments which can be utilized in an organization, and so forth additionally helps you determine the suitable individual to ask any questions you may need when you discover the codebase.

For instance, once I joined Disney nearly six years in the past I wasn’t all that acquainted with Swiftlint. I had heard about it however I had no thought what it did precisely. Within the codebase, I noticed some feedback that regarded as follows:

// swiftlint:disable:subsequent cyclomatic_complexity

After all, I might paste this remark into Google and go down a rabbit gap on what’s taking place and I’d in all probability have discovered rather a lot about Swiftlint however as a substitute, I selected to determine who is aware of most about Swiftlint inside the workforce. Absolutely that individual might assist me be taught rather a lot about what Swiftlint was used for and the way it works.

I requested my workforce lead and by chance it was my workforce lead that truly knew tons and plenty of issues about Swiftlint, the way it was arrange, which linter guidelines we used, and so forth.

We had a superb chat and by the top of it, I knew precisely why we had Swiftlint at Disney Streaming, which guidelines we had disabled or enabled and why, and why it was okay to disable sure guidelines typically.

Google might have taught me that the remark you noticed earlier disabled a selected linter rule to permit one exception to the rule.

My coworker taught me not simply what that remark did but in addition why it did that. And why that was okay. And once I ought to or shouldn’t disable sure linter guidelines myself.

One other instance is a more moderen one.

One among my shoppers had a pretty big codebase that has had many individuals engaged on it through the years. There’s some Goal-C in there, a lot of Swift, it has UIKit and SwiftUI, a number of structure patterns, and way more. It’s a correct legacy codebase.

As a substitute of figuring the whole lot out by myself, I had conversations with a lot of workforce members. Typically they have been one-on-one conversations however different occasions I met with two or three individuals without delay.

Via these conversations, I discovered about numerous architectural patterns that existed within the codebase. Which of them they thought-about to be good suits, and which of them they have been seeking to section out. I discovered why sure bits of code have been nonetheless in Goal-C, and which elements of the Goal-C codebase ought to be refactored ultimately.

I discovered that sure workforce members had spent a number of time engaged on particular options, patterns, and companies inside the app. They might inform me why sure choices have been made, and which selections they have been and weren’t notably pleased with.

After assembly the workforce I knew a lot extra in regards to the venture, the codebase, the individuals engaged on the venture, and the way issues transfer and evolve inside the workforce. This was extremely useful info to have as soon as I began to discover the codebase. Via understanding the workforce I knew a lot extra in regards to the why of some bits of code. And I knew that some code wasn’t price exploring an excessive amount of as a result of it will be gone quickly.

On high of that, by understanding the workforce, I felt extra empathic about bits of code that I didn’t like or didn’t perceive. I do know who was more likely to have labored on that code. So as a substitute of getting annoyed about that little bit of code, I knew who I might ask to be taught extra in regards to the complicated part of code.

Break issues

Along with assembly the workforce behind your new codebase, you’ll need to begin exploring the codebase itself sooner somewhat than later. One of many key issues to determine is how the venture is ready up. Which code is chargeable for what? How does one factor affect the opposite?

Hopefully, the codebase follows some well-established patterns that provide help to determine this out. Regardless, I discover it helpful to try to break issues whereas I discover.

By introducing flaws within the enterprise logic for an app on objective, you may be taught rather a lot in regards to the codebase. Typically it helps you uncover sure “this could by no means occur” crashes the place a workforce member used a drive unwrap or wrote a guard let with a fatalError inside.

Different occasions issues break in additional delicate methods the place the app doesn’t fairly work however no errors are proven. Or perhaps the app is excellent about dealing with errors and it signifies that one thing went unsuitable / not as anticipated however the app informs you about this.

Whenever you break the networking layer in your app, you may uncover some hints about how the app handles caching.

By making small adjustments that probably break the app you may be taught tons. It’s a method I typically use simply to see if there are any threads I ought to begin unraveling to be taught increasingly more in regards to the cool particulars of a codebase.

After all, you don’t need to go round and begin poking at random issues. Normally, once I begin exploring I’ll select one or two options that I need to deal with. That is precisely the main focus of my subsequent tip.

Deal with a slender scope

Whenever you be part of a big sufficient codebase, the thought of getting all of that code in your head sooner or later sounds unimaginable. And actually, it in all probability is. There’s a superb likelihood that almost all builders on the workforce for a big venture could have one or two elements of the codebase internalized. They know the whole lot about it. For the whole lot else, they’ll roughly know which patterns the code ought to observe (as a result of the entire workforce follows the identical patterns) they usually may need some sense of how that code interacts with different modules.

General although, it’s simply not life like for any workforce member to know the entire ins and outs of each module or characteristic within the codebase.

So why would you be trying to discover your entire codebase abruptly?

In case you’re employed on a selected workforce, deal with the code that might be maintained by that workforce. Begin exploring and understanding that code in as a lot element as doable, have workforce members present you ways the code works, and see for those who can break among the code.

Typically there will likely be bug tickets or options which you can begin to provide you a superb start line to start studying extra a couple of codebase. If that’s the case, you should use your tickets that will help you decide your scope. In case you’re engaged on a bug, deal with understanding the whole lot you may in regards to the part of code that appears probably to be the supply of the bug.

And as at all times, you’ll need to be in contact with the workforce. Ask them in the event that they may also help you discover one thing to deal with initially. When you may have a bug ticket to work on, see if any individual on the workforce may also help you kickstart your analysis; perhaps they’ve some ideas on the place you can begin trying first.

And in a great world, leverage pair programming to double the pace at which you be taught.

Leverage pair programming

One software that I normally discover to be immensely underused is pair programming. In a lot of locations the place I’ve labored, builders favor to work alone. Headphones on, deep within the zone. Questions ought to be initiated on Slack so that you’re disturbed as little as doable. Disable notifications if it’s important to.

There’s completely a time and place for deep targeted work the place you’re to not be disturbed.

Nevertheless, there’s an unlimited profit in pairing up with a teammate to discover subjects and work on options. Particularly whenever you’ve simply joined a workforce, it’s tremendous essential you may have entry to your workforce members that will help you navigate the corporate, workforce, and codebase.

Whenever you’re pairing with a teammate throughout your exploration section, you may take the wheel. You can begin exploring the codebase, asking questions on what you’re seeing as you go. Particularly when you may have one thing to work on, this may be extraordinarily helpful.

Any query or thought you may need can instantly be bounced off of your programming companion.

Even for those who’re not the individual taking the wheel, there’s a lot of profit in seeing any individual else navigate the code and venture you’ll work on. Pay shut consideration to sure utilities or instruments they use. In case you see one thing you haven’t seen earlier than, ask about it. Perhaps these git instructions your coworker makes use of are utilized by everyone on the workforce.

Particularly when there’s debugging concerned it pays dividends to ask for a pairing session. Seeing any individual that’s skilled with a codebase navigate and debug their code will educate you tons about relationships between sure objects for instance.

Two individuals know multiple, and that is very true whereas onboarding a brand new coworker. So subsequent time a brand new individual joins your workforce, provide them a few pair programming periods. Or for those who’re the brand new joiner see if there’s any individual concerned about spending a while with you whereas working by some issues and exploring the codebase.

Use breakpoints

Once I was engaged on this put up I requested the neighborhood how they wish to discover a codebase and lots of people talked about utilizing a symbolic breakpoint on viewDidLoad or viewDidAppear which I discovered a reasonably cool strategy to studying extra in regards to the completely different views and think about controllers which can be utilized in a venture.

A symbolic breakpoint permits you to pause the execution of your program when a sure methodology is known as on code you won’t personal. For instance, you may have a symbolic breakpoint on UIViewController strategies which lets you see each time a brand new subclass of UIViewController is added to the navigation hierarchy.

Understanding this type of stuff is tremendous helpful since you’ll be capable of be taught which view controller(s) belong to which display fairly shortly.

I haven’t used this one rather a lot myself however I discovered it an attention-grabbing thought so I needed to incorporate it on this checklist of suggestions.

In Abstract

Whenever you be part of a brand new workforce, it’s tempting to maintain your head down and examine your new codebase. In your head, you may assume that you just’re anticipated to already know the whole lot in regards to the codebase although you’re utterly new to the venture.

You may assume that every one patterns and practices within the venture are business normal and that you just simply haven’t labored in locations nearly as good as this one earlier than.

All of those sorts of concepts exist in just about anyone’s head they usually forestall you from correctly studying and exploring a brand new codebase.

On this put up, you may have discovered some recommendations on why human interplay is extraordinarily essential throughout your exploration section. You additionally discovered some helpful suggestions for the extra technical facet of issues that will help you successfully deal with studying a brand new codebase.

Good luck in your subsequent journey into a brand new codebase!

Recent Articles

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox