Live data from Hacker News

How to join a team and learn a codebase (2020)

samueltaylor.org

41–50 of 58 posts

Re: How to join a team and learn a codebase (2020)

#41
post #10
post #9

Earlier quoted context omitted.

2. Document the steps to setup dev environment in your own words and highlight the issues that you run into This is the most significant thing for me getting up to speed on a new or old project. I absolutely hate reading some whacky custom dependency, jboss, hell like project setups. They just kill morale. And I feel really bad when I see new starters wade into the tall grass on this stuff. I can almost see the momen…

I recently joined a new team and codebase. There was no 'getting started', no docs. I was left on my own. So I muddled through. And documented everything in Makefiles. Not readme, but working code. Now `make clean` `make install` etc, all run, deploy, install, clean etc the project. A great way to learn. But unfortunately worthless to others in the team, as they all were entrenched in their own ways and setups. I jus…

What is the benefit of makefiles over bash scripts?

Re: How to join a team and learn a codebase (2020)

#43
post #26
post #14

I would recommend that when someone is new in a large project with an older code base, to pay attention and learn from others. A mistake I often see is too many “suggestions for improvement” too early. This behavior, when excessive as it often is, is perceived to be invalidating tough choices that were made before your time and chances are that the people who made the choices had good reasons for it and are more expe…

A good senior would explain the "good reasons". A bad senior would be annoyed that the choices are questioned. As a leader I tell my "apprentices" to always question me what the reason is for doing something. Being in a leadership position is not just about your pupils progress, it's just as much about your own learning. You learn a lot when you have to explain stuff. It can be very humbling when you try to explain i…

Often the reasons are not clear because they are not documented it, often only the dev who did it would really know.

Also, it's probably worth taking note of 'fresh eyes' because they have the advantage of hindsight which is often good. That said, there usually complex elements of incumbencies so I do think it should be some time before people have too much lean in.

Re: How to join a team and learn a codebase (2020)

#44
post #5

3 things that helped me become productive on new codebase faster 1. Start with a goal to fix a tiny issue. It will help you not go too deep, too early and yet give you an overview of the codebase. 2. Document the steps to setup dev environment in your own words and highlight the issues that you run into 3. Take time to learn the new Library or the tooling you encounter. Learn with the goal of familiarise yourself wit…

4. Teach the next hire after you, how to do 1-3.

Re: How to join a team and learn a codebase (2020)

#45
post #5

3 things that helped me become productive on new codebase faster 1. Start with a goal to fix a tiny issue. It will help you not go too deep, too early and yet give you an overview of the codebase. 2. Document the steps to setup dev environment in your own words and highlight the issues that you run into 3. Take time to learn the new Library or the tooling you encounter. Learn with the goal of familiarise yourself wit…

Document the steps to setup dev environment in your own words and highlight the issues that you run into

Lots of people are commenting saying they have problems with this.

The first thing I do when working on an unfamiliar project is to write a SHELL SCRIPT that records everything I did. I keep that at the root of the git repo, usually as "run.sh".

For example here is what I did when hacking on Kernighan's awk 5 years ago:

https://github.com/andychu/bwk/blob/master/run.sh

So now 5 years later I can see exactly where I downloaded the source from. I count how much source code there is in a repo to get a feel for it, and I have that exact command recorded.

And I was trying to figure out how much test coverage there is, so I ran a bunch of gcov stuff, which involve Python.

The shell script may have some problems now, but the point is that I can tell within 10 seconds what I did 5 years ago. And I can fix it in a few minutes.

It costs so little to write down these commands that it's worth it. If you try to make it really rigorous then you're not going to do it. Th

In summary, I suggest becoming SHELL LITERATE and checking in shell script with comments. The point is that shell is ALREADY what you're typing, so you can save it exactly like it is in a file, and run it later. (You can also use a Makefile, but then you lose that property, and that matters. Make has all the gotchas of shell plus some more.)

https://news.ycombinator.com/item?id=25400278

(I have a couple upcoming blog posts that mention this. Another view on this, regarding releases: http://www.oilshell.org/blog/2020/02/good-parts-sketch.html#...)

----

Another meme I use is "never remember a port number".

I have had the experience of pair programming with people and they are trying to remember port numbers. Sometimes the server doesn't print it out to the console.

Sometimes they go digging through their notes, or they go digging through Python source code to find the port number.

I always know the port number because I put it in a shell script at the root of the repo.

If you automate stuff like this you can get to the meat of the problem a lot faster.

Re: How to join a team and learn a codebase (2020)

#46
post #20
post #10

Earlier quoted context omitted.

I recently joined a new team and codebase. There was no 'getting started', no docs. I was left on my own. So I muddled through. And documented everything in Makefiles. Not readme, but working code. Now `make clean` `make install` etc, all run, deploy, install, clean etc the project. A great way to learn. But unfortunately worthless to others in the team, as they all were entrenched in their own ways and setups. I jus…

Your team sounds a little broken. If a new starter came in and did that for our project, I’d be really pleased. Once you have that stuff setup, and you’re doing “day to day” coding, it’s hard to find time to go back and sort that stuff out. It’s something a new starter can take on that ultimately gives good long term outcomes.

Exactly. Sounds like rot has settled in and there’s a serious lack of empathy for coworkers (who have to wade through that tall grass like those before did). Cut the grass. Better yet, pave it. Docker compose up your dev environment. Make it so going from clone->pr is as quick and painless as possible.

Re: How to join a team and learn a codebase (2020)

#47

I wonder why no one has not mentioned tests. For me, the tests are more valuable for system or service understanding than, for example, documentation. But the best scenario when you combine tests and documentation. I have joined the new team recently. They have a lot of e2e BDD tests implemented using the Cucumber framework. It helps me to get a complete view of the system in the shortest possible time.

Somewhat related; I've always been very curious why a lot of developers I've worked with seem to think testing isn't worth the effort, and I've been keeping a mental checklist of all the reasons/excuses I hear so that I can reflect on them as well against my own experiences - sort of a way to challenge myself and ensure I'm not just cargo-culting methodologies.

Recently I decided to go through `Growing Object-Oriented Software - Freeman, Pryce` (and actually finish working through it this time) with the goal of understanding what "proper TDD" is supposed to look like. Something interesting I noticed is almost all the complaints I've seen as reasons against TDD/certain testing methods all seem to be examples the authors use as how not to use TDD/testing. It seems to me that a lot of developers have just learned _of_ these techniques by name, and haven't really put a lot of time/effort into practicing their application and instead just seem to write them off on face value or by the literal interpretation of their names.

One example, a lot of people I speak with seem to think TDD is very literal "write a _unit-test_* for everything before you write the implementation OR ELSE...", but of course there's a lot more nuance than that depending on the situation. The book actually puts a huge emphasis on having your initial test(s) be end-to-end tests that slice through the system as a whole, with the idea being to create nested feedback loops of varying granularity/abstraction to allow you to iterate without fear. This was something I never heard emphasized at all when I started learning about TDD, or hell even in a paid course my employer put us through by a "TDD expert".

I should also clarify, I only consider these claims from developers that have a proven track record of working on large/complex systems since, well, those who don't probably haven't cultivated their ideal workflows/approaches yet (or just haven't been given the opportunity to showcase them, as is common in large companies).

* I emphasize unit-test because a lot of code bases I've worked in rarely have anything other than just unit-tests...

Re: How to join a team and learn a codebase (2020)

#48

I wonder why no one has not mentioned tests. For me, the tests are more valuable for system or service understanding than, for example, documentation. But the best scenario when you combine tests and documentation. I have joined the new team recently. They have a lot of e2e BDD tests implemented using the Cucumber framework. It helps me to get a complete view of the system in the shortest possible time.

I'm skeptical that you get a view of the system through BDD tests better than with somebody walking you through the product. The person can explain the domain, the context, the subtleties, skip the not-actually-interesting-parts, draw things for visualisation, etc while adapting the explanations to the fact that they're talking to a newcomer: the tests do none of that (but maybe I've never done BDD properly)

Re: How to join a team and learn a codebase (2020)

#49

Earlier quoted context omitted.

This is a pretty one-sided take. I think it’s quite possible to lose perspective when working on a large codebase. It’s also possible to have small bits of technical debt accumulate without anyone feeling the total weight of it all. Old code can use whatever fad was most popular when it was written or it can carry the cruft of old dependencies or api changes. Just because something is old it doesn’t mean that it’s go…

Of course. But as a newcomer, you cannot know which one it is, and as the OP said this behaviour has a lot of chances to be perceived as invalidating. I've been on both sides of this situation, and in both cases I felt that it was almost disrespectful, it's sending the message that you don't think the team is competent enough to have considered them and carefully picked trade-offs. When I was on the receiving side (t…

I typically advise new hires to keep a “dirt doc” of things they think could be improved, and have them come back to it after they are more up to speed (say a month or two in).

The insights that you get from coming at the problem with fresh eyes are invaluable and you really don’t want to waste those. But many things on that list will evaporate once you have a bit more understanding of the project.

(I still like to make “check in a fix / improvement to the dev environment documentation” the first task for a new starter though, as there’s usually a typo or update required somewhere).

Re: How to join a team and learn a codebase (2020)

#50
post #5

3 things that helped me become productive on new codebase faster 1. Start with a goal to fix a tiny issue. It will help you not go too deep, too early and yet give you an overview of the codebase. 2. Document the steps to setup dev environment in your own words and highlight the issues that you run into 3. Take time to learn the new Library or the tooling you encounter. Learn with the goal of familiarise yourself wit…

I just joined a new team as a lead and #2 is killing me, to the point where I have felt like giving up. The documentation my team was given was a hastily thrown-together hack that was full of missing and incorrect steps. It should not take more than a few days to set up a local development environment, but I’ve had to fight for admin rights, ask a million questions, and have other leads work with me for days on end (…

My team has a story that is dedicated to setting up a `dev` environment for when a new repo is started.
Post reply on HN