I am a self-thought newbie programmer and I am working on my first web application - a website on which users can register, log in, and then post things into a database or search the database.
I am currently at about 150 files, and have learned a lot in the process. My coding skills have gone though the roof (compared to what they were before).
Now I am at a point where I am a little stuck. I know there are still many security issues with my site (I know what to do to fix them), also I realized that I used a depreciated function (the old PHP mySQL API) and I have just discovered a much better way to handle post data. Also I noticed, that my website is starting to get kind of slow, and I think there are a couple of places where I could condense my code.
I have tried to keep my code neat, organized and well structured. However, some files have gotten a little out of hand as I added to them. One of my worst files is 550 lines long, other files I am having trouble figuring out what exactly I was doing...
I am torn back and forth between the idea of rewriting everything from scratch and trying to fix those issues, which I know about.
I feel like I might be able to do a much better job, doing it all over from the beginning (after all I have gained so much experience since I started). At the other hand I am sure it'll take FOREVER, even though I might be able to just copy and paste a few sections.
Like I said, there are many new features and techniques I have learned, which I could now implement, to improve the site - but I am also afraid that a couple months down the road I might have issues like that coming up again, and find myself in the same position of debating whether or not to rewrite the code.
So my question to the experienced programmers is: Would it be a good idea for a newbie to rewrite the code from scratch? Or will every programmer find themselves in this position after a while of programming, that everything seems like it might need a makeover?
I did read this article When to rewrite a code base from scratch but I feel like my question comes from a different perspective. It's not like I've been handed this code, but i wrote it myself!