Lets share your views on handling large scale codebases

I've been trying to implement a new feature in the Luna Engine for a month, as doing so needs to rewrite more than half of it. I've vaguely guesstimated the size of its codebase to be something like 30000 LoC.

As I was previosuly comfortable with the 10000 LoC scale only, it turns out my attempts are extraordinarily tiring to me and I'll have to put forth exceptional amounts of efforts, even though I still want to get over it.

While I know even 100000 LoC can be considered small in the professional software engineering world and I've searched in the internet to found that some guys claimed to be able to manage that scale completely on their own, even 30000+ LoC codebase is exceptionally large in RMVXA as few RMVXA engines/systems ever reach this scale. While I'd guess many complete softwares that are designed to work with RMVXA are way larger than that, the number of such softwares are small compared to the number of scripts and engines/systems. So I'll still regard 30000 LoC scale to be relatively large enough to be considered to be large.

Of course there are some sayings that can help, like "work on 1 single small unit at a time", "break down the original gigantic goals into several smaller ones each serving as a milestone", "reward oneself whenever a milestone's reached", "keep motivated and passionate on the goals", "enjoy the process as well as dream for the results", "be diligent and hard working on what's worth the efforts", and lots of the other wisdoms.

Nevertheless, I still want to listen to your approaches and experiences on handling large scale codebases and learn from what you've shared here. Large here can be relative to you, the entire RMVXA scripting world, or even the whole software engineering realm. What do you feel/think when you've to handle large scale codebases on your own? Do you want to run away or just stick to them? Do you value being able to handle large scale codebases on your own? Do you prefer to handle them with a team instead of on your own? What do you think about large scale codebases in general? Let's share your thoughts here 🙂

P.S.: While LoC doesn't tell the whole story of the codebases' scales(some may have tons of boilerplates, comments, decorations, junks, etc), it's still an acceptable estimate on how large those codebases are 😀
I don't see any difference between 10.000 and 30.000 lines. Why would the total number of lines matter?
I don't see any difference between 10.000 and 30.000 lines. Why would the total number of lines matter?
I think it's my own problems that I'll have to overcome somehow.

Back on 1 year ago, when I start to write ECATB, I was comfortable until the codebase reached the 3000 LoC mark. Then suddenly I feel extremely uncomfortable when I tried to continue to add more and more features, so I ended up to have to polish the core features first before adding optional ones. The same headache happened at the 6000 LoC mark, and even myself feel strange about it. Nevertheless, I do(or at least did) have such problems, which caused me to need 7 months to finish the 1st testing version of ECATB.

Now similar things happened when I try to implement that new feature in the Luna Engine. Although I've learned from my ECATB experience and I instead just focus on rewriting 1 single configuration part at a time, I still feel so tiring that I've to constantly deal with my unwillingness so I can continue my work. If I take a break whenever I feel uncomfortable, I don't think I'll be able to finish it before RMMV will be released lol

Uptil now, I also don't know why I have such problems, but it seems to me that there's always a maximum LoC scale that I feel comfortable to work with. If that's the case, all I can do is to try my best to raise that maximum as much as I can XD
Ah, but that is a normal reaction when reading a new codebase that you're not familiar with. Once you get used to the way Luna Engine works, you'll be able to change anything you need on it.
Ah, but that is a normal reaction when reading a new codebase that you're not familiar with. Once you get used to the way Luna Engine works, you'll be able to change anything you need on it.
So maybe effort and time are the only cure 😛

Nevertheless, it seems to me some guys can become familiar with new large scale codebases(like 100000+ LoC) on their own rather quickly(like within weeks). I've searched in the internet and some guys claim that they're just that capable 😉
My Info Windows Script was over 2000 LoC and it took me forever (I kept getting busy in rl and had to figure out where I was).  I was really hard, but by the time I got done, I had learned a lot and that made me feel good.

I don't know if I could handle 10,000 LoC on my own, I know now that writing effective comments really helped me and were worth the extra time.
I don't know if you're still looking for input on this or not. It's been a while since I've worked on large codebases, but here's what I remember from that other life: 

First understand what every part is doing in relation to each other - like gears in a machine or whatever metaphor you want to pull up. Mentally picture the dependencies and workflow. 

Learn to recognize patterns. Design patterns, file patterns, there's very little 'new' under the sun. The more code you read, the better you'll get at this. And yes, I recommend finding good code and reading it.

Do not be afraid of pencils, paper, markers, and a big white board. Draw out templates, flow charts, or anything else you think will help you keep things straight on the section of code you're working on. The big picture is important, but the devil is in the details.

Original thread: https://forums.rpgmakerweb.com/threads/lets-share-your-views-on-handling-large-scale-codebases.45120/