Live data from Hacker News

On navigating a large codebase

blog.royalsloth.eu

1–10 of 139 posts

Re: On navigating a large codebase

#3
This is a great article. I felt like it was describing a job I recently left, especially this piece:

> It’s fine to have less experienced people working on a large system as long as they have the elders overseeing their work. In the world where senior titles are handed left and right, that is often not the case and it’s how you end up with a very fragile system that is suitable for a replacement as soon as it was built

Then I got to the advice part of the article and had to laugh.

Read the documentation? What documentation. Not a single scrap existed.

Look at the tests? I'd love to, but they never wrote any.

Code comments? Nah.

Use the IDE for intellisense? Great idea except the database models are in a different project so the furthest you can get is the compiled definitions that were copied into this project.

The method that eventually kind of worked was "use the debugger for absolutely everything."

It was honestly one of the most miserable experiences I have ever had.

Re: On navigating a large codebase

#5

This is a great article. I felt like it was describing a job I recently left, especially this piece: > It’s fine to have less experienced people working on a large system as long as they have the elders overseeing their work. In the world where senior titles are handed left and right, that is often not the case and it’s how you end up with a very fragile system that is suitable for a replacement as soon as it was bui…

[deleted]

Re: On navigating a large codebase

#7

Are there any visual "code flow" interpreters? Something that would separate the 1000s of interactions between functions and show flow lines between them?

Came here to ask the same question. I've tried to find something like this for golang and the tools out there can't handle large codebases.

Re: On navigating a large codebase

#8
> In 1980’s Tim Berners-Lee realized that the documents are hard to find at CERN, so he started imagining a system of interconnected documents that would supposedly solve this thorny problem for good. Nowadays we know this invention as the internet. > Despite 40 years of improvements and the internet becoming a part of our daily life, we still face the same problems. You can talk to another person half way across the world while watching a funny cat videos, but somehow we still struggle with finding the important project documents

TIL. But I think the author meant the Web[0]. Iirc internet originates from ARPA.

0: https://home.cern/science/computing/birth-web

Re: On navigating a large codebase

#9

Are there any visual "code flow" interpreters? Something that would separate the 1000s of interactions between functions and show flow lines between them?

Sourcetrail?

Yep, Sourcetrail can do that, for the languages it supports. (It has an SDK so additional languages can be added, with effort.) Give it a method, another method, and it will draw a line from point A to B (with all the functions in between) using static analysis plus you can explore before and after to see what calls what. You can even see field usage though there it can be confused sometimes, understanding varies by language. But it’s still really useful. Doesn’t yet support cross-language integrations but it has a lot of potential now being open source. It works great for individual developer use, for team use I’d want to try my hand porting it to React or the web in order to more easily share views with others, and perhaps use a central database. For now you can make Sourcetrail projects as part of a CI system to share them with other team members.

In addition to Sourcetrail, I also recommend adding OpenTelemetry for distributed projects or flame graphs for less distributed ones. Some of the videos Honeycomb.io put together really highlight the value of distributed tracing, such as this one: https://youtu.be/GuIWQ-EF7YE and the OpenTelemetry Collector makes it simple to filter telemetry, route it to services or drop a majority of traces which don’t have exceptions, for example.

One day I hope OpenTelemetry tracing can be baked into any language the way flame graphs tend to enjoy first-class support in Java, and that tools like Sourcetrail can be baked into IDEs such that runtime metadata is available just by hovering your mouse over modules and functions. Kind of like CodeLens shown here, but for understanding the code: https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp...

Something like https://www.codestream.com/use-cases/code-documentation works as a social network and documentation hub but doesn’t necessarily bring in production telemetry or models/ontology from code (such as Lattix, but that’s specialized to code organization in a way…) Maybe Project Cortex but for source code? https://techcommunity.microsoft.com/t5/microsoft-365-blog/in...

JetBrains Space or GitHub doesn’t yet analyze code beyond dependencies/security issues/CI but might in the future.

Finally, there are tools like https://backstage.io/ which hint at a future where developers build their own infra tools for the rest of the company to use… but that hasn’t extended much into the realm of modelling, documentation or telemetry yet. Folks might be lucky if they have a hosted copy of SourceGraph right now… the future, I think, builds on all of these ideas.

Post reply on HN