The most phenomenal slack message that I have ever received in my life

The most phenomenal slack message that I have ever received in my life

I have some really amazing people working on my new team. Today I asked an absolutely phenomenal Senior Machine Learning/AI engineer how to approach a new codebase and I honestly just got back the most amazing reply that I have ever received in my life. Wow.

How to approach a new codebase: the senior edition

My Senior told me that he doesn't usually bother with trying to read the whole codebase at once, because it can be pretty overwhelming.

This is great advice as I think I normally get bogged down with trying to sit down and trying to understand everything. Not surprisingly I usually get overwhelmed after an hour or so, so then I just have to stop. So this is really amazing advice from my wonderful colleague.

First look at any useful documentation that exists

  • You can then try to understand it at a high level, and understand the overall structure and the key components of the codebase 
  • So for example - instead of trying to understand everything in the codebase - you can try to understand the OVERALL STRUCTURE of the CODEBASE.
  • Instead of trying to understand every line of code and every import and every variable (Whoops!), try to understand the main FUNCTIONS, CLASSES, COMMANDS, MODELS, etc., and what they are doing (this is just an example).

Try to build it locally and use it like a user would

"If possible, build and run it locally and try and use it like an end user would." This is the most phenomenal and amazing advice that I have ever received in my life. I have been told to do this before with other codebases in my life, but never so explicitly.

I have struggled to do that sometimes before as it is a bit scary (it is still kind of new to me sometimes) - but this is absolutely the way forward and the best thing to do.

I am not sure if my current project can be built out, but I will speak to my Lead developer about this.

Once you have a good understanding of the structure

"Once you have a good understanding of the structure, then you can try and understand the specific part of the codebase you want to contribute to in greater detail."

WOW. Wow, wow, wow.

Once you have a good understanding of the structure, then you can try and understand the specific part of the codebase you want to contribute to in greater detail

Once you have a good understanding of the structure, then you can try and understand the specific part of the codebase you want to contribute to in greater detail

Once you have a good understanding of the structure, then you can try and understand the part of the codebase you want to contribute to in greater detail

Once you have a good understanding of the structure, then you can try and understand the part of the codebase you want to contribute to in greater detail

So in other words, what he is saying is that: once I understand the STRUCTURE of the CODEBASE in GENERAL, I can TRY TO UNDERSTAND THE PART OF THE CODEBASE THAT I WANT TO BE CONTRIBUTING TO in GREATER DETAIL

So once I understand overall and in GENERAL WHAT THE MAIN STRUCTURE OF THE CODEBASE IS 

I can GO TO THE ACTUAL PART OF THE CODEBASE I NEED TO CONTRIBUTE TO

And then I can TRY AND UNDERSTAND THE CODEBASE I ACTUALLY WANT AND NEED TO CONTRIBUTE TO - IN MORE DETAIL

I think that this means that - I can try to understand the bit of the codebase in more detail - but only the part that I am ACTUALLY CONTRIBUTING TO.

Approaching the specific part of a codebase

APPROACHING THE SPECIFIC PART OF A CODEBASE

APPROACHING THE SPECIFIC PART OF A CODEBASE

My Senior said to me that:
  • He often runs "things in debug mode and steps through", to see what the variables are doing at each stage.
  • I don't really know what debug mode is - sorry 😭😭😭🔮
    • What is debug mode? I guess I need to look it up.
    • I kid of get in principle what debug mode is - as a software engineer - but I still need to know more about 
      • WHAT it is
      • HOW it runs
      • and HOW to get it on
My Senior said that:
  • If the codebase has GOOD UNIT TESTS, "they can be  HELPFUL IN UNDERSTANDING WHAT DIFFERENT SECTIONS OF THE CODE DO". 
  • Again, it often is USEFUL TO RUN IN DEBUG MODE TO "UNDERSTAND THE FLOW OF THE CODE".
  • I still don't know what this debug mode thing is. 😍💜😍
  • I really really really do need to find out.

In conclusion, he said that:

"It shouldn't be necessary to have a super deep understanding of the whole codebase before you can start contributing to the code."

My conclusions are:
  • I still don't know what debug mode is
  • I am not contributing to the codebase yet - just familiarising myself with it - maybe that is the problem. I ALWAYS FIND IT EASIER TO LEARN WITH A CONCRETE GOAL.

"I think angels surround ya"

One of my favourite quotes from one of my favourite songs.

I think that to receive a message like this is something truly angelic.

If you read this - thank you so much.

So here, please have one of these angels that I used to share a lot when I was writing all the time about AI...

A painting of an angel.
Kontrola, CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0>, via Wikimedia Commons



Comments

Popular posts from this blog

Hello World

Yosemite

Where To Hide A Star