For the last few weeks I have been working on major refactoring project. It has become too much time consuming to add new functionally, make changes to an old app I have made a couple of years ago. When the initial project started I kept coding giving too much thought about future self. As long as things work as expected who cares what happens in the future. Now that future is here, every time I need to add some functionality to the code I need to get familiar with the initial code again, again, and again. My past self didn't take into account it would become necessary to make changes because structure of data it uses changes, or source of the data went through changes, or all dependencies wouldn't consult with me before making the updates. However, outside factors weren't the biggest problem. Even with all the changes in the outside world, the app did work just fine without throwing errors. The most challenging part became adding new functionality. That is because of poor code structure, and zero planning for the future.
I had some time to revisit the project and this time I was ready to refactor in a most planned manner that any future updates would only require working with small parts of the code and not in its entirety. After four days of disciplined and determined review of the code, breaking into many pieces and putting things back together in a much more readable, understandable, and organized fashion, I got stuck. I am stuck. The reason I am stuck is before fully finishing refactoring, I got distracted with improving the core functionality of dealing with all data retrieved from various documents and sources. Initially, this didn't bother me and I thought I could do both, refactor the code and rewrite some parts simultaneously. I was wrong. I couldn't finish either. Now its been two weeks since I haven't made any progress.
Usually, I welcome the frustrations that come with coding. Because they lead to new discoveries, feeling sense accomplishment one solutions are found. But those frustrations happen when there is bug in the code, and code is not working, and something needs to be done to get things back working. Most of the time solutions are easy to find, and walking away from the task and taking break helps resolving the issues. However, this time I have a different problem. I don't any errors or bugs. Everything works just fine. I am stuck in rewriting the core logic of accomplishing something that it already does ok. I convinced myself that there is a better way, and it actually is better. Test versions are working great. I know all the steps that needs to be taken, I think. I know what needs to be done, I think. I know what end result should look like. However, there are multiple ways of achieving this. What I am not convinced about is which route to take.
The worry is that after all the time spent, the result end up being the same as before. What I am concerned most about is the unexpected. There are things here that are beyond my control and rely on outside factors. Am I am considering all the potential outside factors that may end up breaking the functionality? Or I am overthinking it. Or maybe I should be over thinking, since not doing so first time got me here. Part of me wants to just shut down the computer, and forget about it for another couple years and revisit if it really becomes necessary. Sure things don't work the way I want now, but they work just fine. Is just fine ok? Or maybe a little bit more work and things will be a lot better and I won't have to think about this project any more.
This project is not of highest priority at all. I started refactoring just because it felt like it was time and I had some spare time. I thought it would go a lot quicker, and do not drag for weeks. I don't like when things take too long like this, especially when I find myself at almost giving up point. I mean, I am not giving up in general. Perhaps it is jut not the time and when the right time comes solutions will appear like magic. They often do. Maybe I need a lit bit more of an inspiration and motivation. Right now it will have to wait. Because regardless how much I want to be done with it, I have no clue how I could achieve this outcome. Not yet.
I am still stuck...