This question already has an answer here:
- When to refactor 9 answers
I'm currently interning at a company where I've been tasked with building an application from scratch. I've been working about 8 weeks, with 4 left to go. I've written a lot of code in that time, but now as I go over it, I'm realizing that it's really quite inefficient, ugly, and going to be hard to maintain for whoever gets this after I leave. I only have a few things left to implement, but I feel like I should place a higher priority on making the code better for future developers before I keep adding to it. Given my timeframe, is it more worth it to finish and then refactor, or refactor now and add afterward?