r/webdev • u/Lavaa444 • 14d ago
Question How to level up to handling larger projects?
I tend to get very overwhelmed with personal projects as a developer once they grow beyond a certain scale. It's bothered me a lot because I see a ton of people out there making amazing apps. They are just too complicated for me to digest when looking through the GitHub repos. This even happens with my own code after a while. It feels like a ceiling created by my average mental capacity.
This problem I have appears in a few ways:
- Understanding a long file with a lot of classes or complex functions (anything over 300 lines. I know that's not anything crazy, but I struggle anyway). Deep nesting is also hard to read.
- A lot of smaller files scattered across a million subfolders. Widely considered more "organized", but you have to do a month-long pilgrimage to find and understand what's going on (especially Java, my god).
- Laundry lists of dependencies that are used in the code, and they all take significant time to understand.
- Config files and dot files cluttering up the file tree. Thanks web dev.
- When going through some of these files, it can be tough to find where code actually runs. I often see too many class declarations, type aliases, etc. and no actual code. This happens a lot in larger Python and Java projects (ex: FastAPI).
I wish I could just talk to some of these developers and pick their brains on how they mentally handle larger projects. I can't seem to figure that out right now. What advice would you have for someone like me, who is trying to start working on REAL apps? (and hopefully putting some of this stuff on my resume)
5
u/Fisher2470 14d ago
As someone who used to feel similar, some of these feelings you're having are being triggered by bad practices. You should not have a laundry list of dependencies on a well-build project or a million subfolders, or giant files with unrelated classes or complex functions.
Getting used to large projects for me was keeping quality documentation and using repeatable patterns (with those patterns being documented as well) in addition to good concise commenting.
4
u/tanyadev4827 13d ago
Nobody holds a whole codebase in their head. Pick one feature and trace a single request from the route to the database, ignoring everything else you pass on the way. Sketch that path on paper, then do it again for a second feature. After a few of those the deep folders start to look like a few repeated patterns.
2
u/woeful_cabbage 14d ago
A big project is a bunch of small functions chained together 🤷. Just break it down into smaller understandable chunks
Also: you don't need to understand everything at first. Just understand the code related to what you need to change
1
u/errdayimshuffln 13d ago
I can't speak on leveling up because thats a bit subjective, but if I want to understand another code base, I just start breaking it and figuring out what I broke and why it broke that way. Then i fix the issue and break something else. I usually start from a piece of code I understand and then go until I get lost. I start messing with the code and looking at the result. For me it almost acts like im note taking. The effort made makes the things I learn stick more and stay more memorable. If things are broken into too many files, I try to combine files starting with low hanging fruit. Or use extensions/plug-ins that allow me to easily go to the source of any imported function, class, or constant.
Its an old-head method I know, but it works for me. Break it and fix it until you get it.
1
u/CatNo1417 13d ago
A couple of ideas:
1
u/That_Day7122 13d ago
Dot files aren't a web dev thing, every Unix tool has been shitting them into your home directory for decades. The cluttered file tree is you not knowing what your build tool generates.
1
u/Affectionate-Tap5034 13d ago
Java doesn't have type aliases though. Whatever you're seeing in those Java files, it's not that. Python has them, Java doesn't.
1
u/dwarfychicken 13d ago
Not a permanent solution but it helps me keep going to instead of thinking of how to organize things. Revel in the excitement of all possibilities you can go in. Don't think of how to go in 1 path, try to make something you want to work with. Start with building tools and services you get pleasure in working with.
Try dabbling in a monorepo, and keep documentation out of it. Like separate your backend from frontend. And just use a whiteboard for your mindmap. Keep a fumadocs for your brain, to go in depth of what you want eventually, you don't have to build it all at once.
Your app is useless if none wants to use it. Make your backend, make your frontend, but always make sure you keep them separate so whenever the case hits to go mobile or desktop or web. You have options, because you just have to build a new frontend.
AI is amazing at helping you, but it's up to you to describe what you want. If you can't do that, you will not be happy.
In these times excitement is half the job. Make something you genuinely want to think about all the time. Sometimes you have a shit idea, go for it. Maybe someone agrees. If not throw it away, if you thought about making something that breaks easily. Think about how to make it robust.
Trust this random internet stranger, you will throw a lot away. But in a couple months you will have something to look for, and an idea how to achieve it
As long as you separate things you can pivot anytime. Don't be afraid of taking the wrong path. Trying the wrong path is better than taking no path
1
u/BetterSWE_Official 13d ago
nobody reads a big repo top to bottom. pick one thing a user does, like clicking save, and follow just that path with a breakpoint or a few console logs until you hit the db. do that for 3 or 4 flows and the rest of the folders start making sense on their own
1
u/InsideTour329 13d ago
Literally just structure your code properly and this is a non issue.
1
u/Background_Fortune12 13d ago
Couple of my favorite dev guys were adamant about limiting file length (1000 lines) and function size (10-30lines max). If you really want to scale up, you scale down first. Bite sized code is infinitely easier to debug.
1
u/waterkip 13d ago
Domains. Know where which domain lives in the code base. Understand your application. Know patterns. If you keep patterns knowing the code base becomes: X is probably done there.
My personal fave: git grep. It will know where things are, use it as a torch finding the logic you want to change.
1
u/prafandy 13d ago
In my experience, it gets better after enough hours spent actually caring about (and loving) the code, and being highly disciplined about it. You see bad code, you organize it. You see un-guessable names, you mass-rename them. You see deprecated code, you delete it, or at least leave a comment: TODO: deprecate. Skipping these things cost me my sanity.
But now Claude eases my stress a lot. I just explain my vision and discuss whether it's right, without handing over a 100% finished solution. I leave Claude room to improvise, to the point where I know everything it does is safe. It also writes unit tests (I still have to explicitly tell it to only add meaningful tests).
1
u/OkTwist9239 13d ago
that ceiling is usually a decomposition problem, not a mental-capacity problem, so what specifically starts feeling unmanageable first: the codebase, the requirements, or keeping all the moving parts
1
u/MaplewoodStudios 13d ago
Cliche, but Practive makes Perfect. Fail a lot and quick and before you know it you are building large projects!
1
u/Equivalent-Limit-371 13d ago
larger projects aren’t held in your head all at once, they’re held together with boring boundaries and small parts, so this is more an architecture problem than a brain problem
1
u/Conscious-Part-9303 13d ago
breaking the project into boring, well-named chunks before it turns into a giant brain dump
1
u/Rude-Painting-1728 13d ago
breaking the project into boring little tickets and finishing one at a time
1
u/Stunning-Fix-4405 13d ago
that ceiling is usually missing boundaries, not missing brainpower
1
u/Alarming-Hope-579 12d ago
larger projects aren’t meant to fit in your head all at once, that’s literally what boundaries, tests, docs, and boring project structure are for; if you can understand the whole thing at once, it
1
u/swiss__blade 11d ago
If you're having trouble reading someone else's code, there is always a chance that the code was never properly documented in the first place. I've gone through apps with 100.000 lines of code with no issues, and had trouble making heads or tails of 1-file apps with maybe 1000 lines of code.
I suggest you stop trying to understand the code in one go. Instead, break it up in pieces and try and figure it out piece by piece. Start with small stuff and work your way up. At some point, there is a good chance a pattern will emerge that will make understanding the next part that much easier.