C
C#4mo ago
Hound

Approaches to get around a big codebase

Hi guys I am second month in a new job, so far I've working for couple of years with a lot of Python, C/C++ projects with VSCode on Linux, thats the environment I am used to. Now I am working on Windows using Visual Studio on two solutions the C++ and C# one, that have hundreds of projects and they are dozens of millions lines of code. I am trying to get some work done on the C# solution, however, its a product that has a long history, there is a lot of weird design decisions, lack of documentation, extreme complexity, inconsistent style, tons of code, tons of components - lot of different processes each with a lot of different threads, communicating with different services across several machines of different architectures. Now getting around this is a headache, especially because I don't even know Visual Studio or other tooling very well. Do you have some tips for tools, articles, whatever how to get some high level sense of what is going on in such context fast? I am talking about the C# solution. Attaching to more than 1 process in VS and debugging it (without opening 1 instance of visual studio for each process)? Maybe lets simplify. Lets talk about following scenario: You have a way to trigger some routine and you know which one, you can breakpoint at start of that. Finding what you need by going through the whole flow is very time consuming. Can you get a call/flow graph of that routine somehow? Find out what threads that routine spawns? In what parts does it do network communication, maybe somehow set a break point when it reaches for some system functionality - threading, networking, creates locks or I/O in general. Anyway, if you have some personal ways to get around very complex codebases, I'd love to hear that for some inspiration to improve my workflow. Thanks!
4 Replies
canton7
canton74mo ago
I think step 1 would be to talk to people who know the project. See what architecture documents exist, talk to someone and whiteboard some stuff if they don't exist. Yes you can tell VS to debug multiple processes at the same time. Configure Startup Projects -> Multiple startup projects
Hound
HoundOP4mo ago
Step 1 was already done, they either didn't know or didn't remember, I have other people to ask, but its friday, so for now I try to as much digging as I can on my own until next week
TizzyT
TizzyT4mo ago
if you have the pro version (dont think its available in community) you can build a dependency diagram
Cracker
Cracker4mo ago
Not sure if its relevant to your case but I used to have that one huge project. I needed to debug some part of if. I could host that project by copy host files from server to my local IIS, then I build the project that I want to debug, I build the project, copy output dll/pdf files to IIS folder and I can attach to debug, make changes and commit this way I was able not have to compile whole project and dependencies, just the project I want to debug and change
Want results from more Discord servers?
Add your server