Although my project is 50,000+ lines of code, |
First point, the more experience you get, the more you will feel embarrassed about your programs consisting of many lines of code. I remember when I first started, feeling very proud I had written about 20k lines of code in one program, then when I started a long painful process re-factoring it to be more organized, and modular, I ended up reducing it to less than 10,000 lines. The first and possibly most important advice I would give is to try and follow the DRY principle (don't repeat yourself).
The main problems I had with using a class was trying to follow the flow of the program's logic through multiple files. This was hard to do. Another problem was dealing with variable scope, but that is another discussion. |
A nice thing about an object oriented approach, or at least a modular approach, is that you shouldn't have to follow the logic of a large complicated program. You should ideally only have to follow logic in one small uncomplicated thing at a time. The large complicated program then is much simpler, because most of the complicated internal implementation details are abstracted from you, and you can manage the larger program easier from a higher level (just like programming in C++ is easier to manage than machine code).
That said, you don't need classes for this, but IMO they are very useful for supporting this. Certainly, you should at least be able to move some of your functions into separate files, without the need to mess with them as you work on your main program.
Another problem was dealing with variable scope, but that is another discussion. |
It think it's not good to be messing with one variable in many different places. This can vastly complicate things, lead to bugs, and make it very difficult maintain the code. This is another issue classes are intended to help with.
It may be that you started doing a lot of programming before learning very much, and developed your own way to be relatively effective in spite of your lack of programming knowledge, and as is usually the case in everything, it is difficult to break your habits or change your style of thinking. The same thing happened to me. My first program was about 10,000 lines of code all inside the main function using goto's, and at that point, I felt the same way you seam to now (that I didn't need anything else). But I'm glad I changed my mind as I got more experienced. You will probably start feeling the same as you begin to run into various issues and you try to resolve them, such as when you want to reuse some of your old code in a new project, or you want to significantly change some things and it becomes very difficult due to the complexity and chain reactions that a single change can cause.