Developers October 6, 2020

What size codebase is too much for one person to manage on their own?

Richard Antao @rmantao

I have developed a MERN web app and API that altogether, probably comes to about 30K lines of code. Now I've written it all by myself and pride myself on how the structure for the code has made it very easy for me to manage on my own.

I'm a self taught developer and have never had a real developer job, so I'm curious: how much code is roughly too much for one person to properly manage? My guess is that after 50k lines my the codebase is going to start to become hard to manage. My question is obviously approximate and anecdotal, just looking to get other opinions and experiences from fellow developers

Note: Specifically talking about navigation through the codebase, not so much the responsibilities (I'm already starting to get overwhelmed by amount of tests I have to catch up on to support the production code lol)

  1. 5

    I have 3 repos that make up Lunch Money and they total over 50k lines of code. So far, it's totally manageable and I don't foresee it getting unsustainable. IMO, as long as you are writing robust, sustainable code, then it should be okay!

  2. 2

    I don't really think it's about the number of lines of code, much more about how it was written. Also, your own code might be much easier to maintain than someone else's.
    Then there's a question of what it was written in too, some languages just make navigation easier than others.

    1. 1

      Your own code is 💯 easier to maintain than someone else's, and it's easier to write too because you don't need to conform to anyone else's standards. So long as you can grok it, if you're the sol dev, then that's good code.

  3. 2

    Hey Richard,

    I have been working on severals project, and my experience taught me that it's not the number of lines of code which is important, but it's more the project's structure, as an example. If you are consistent everywhere on the project, you will feell right at home almost everywhere, otherwise it will be a completely mess !

  4. 2

    Like most things: it depends. While SQLite does have other contributors, it's almost entirely managed by D Richard Hipp, and that is at 116k lines of C code. C code has a lot of foot-gun moments in it, but 116k lines of C code is probably less functionality than 116k lines of Python. My personal monorepo has about 30k lines of Ocaml code which is a fair amount of stuff and haven't hit my limit but I don't necessarily work on all of it often.

  5. 2

    My highest written solo-project was 65k or smth, but I'd guess like 5k lines was overhead that was just there because I blindly followed conventions at the time.
    It was pretty maintainable though.
    At the same time, the c program I wrote years earlier for a calculator is completely unreadable to me now even though its <200 lines.
    It really depends on the structure.

    As for navigation, I use the fuzzy search that vscode provides. For example pressing shift + tabs and entering auc might return the aboutus.component.ts or smth. The file is still in a deep folder structure so I can look if I need to, but I write the filenames in a way that makes it easy to do text search on just that

    1. 1

      That's a great tip, thanks!

  6. 1

    Me and one other guy manage a 7 year old SaaS with hundreds of thousands of lines of code.

    Most of it hasn't been seen or touched in years and just does what it needs to do.
    We're still able to build and add new features with ease.

    One thing nobody ever tells you is that after a few years in a single codebase you really start to figure out smart ways to let yourself continue to build at speed, without existing technical debt holding you back.

    1. 1

      That's awesome! Based on what you said, I'm assuming you're not having to change much in the "legacy" code?

  7. 1

    These days I try to aim for 1k lines of code. 2k max. If it is bigger than that it's a code smell that I am not leveraging other peoples code enough, or using the wrong language, or using the wrong tool, or that the thing I am building has too big of a scope and i need to narrow it down and really focus on the one thing it is supposed to do.

    1. 2

      Only 2k lines?! That seems impossibly small for large scale projects, even with the use of other third party libraries

      1. 1

        large scale projects

        I try to avoid these. I'm a fan of the unix philosophy: do one thing and do it well.

Recommended Posts