Coding Sometimes Is Frustrating

in #codinglast month

coding.png

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...

Sort:  

It’s crazy how you have been trying this for the whole of two weeks and haven’t made any progress and you’re still stuck right now. I know there must be a solution to it. Also, even though the project doesn’t seem like that of highest priority, the fact that you began to refactor is good because the world is dynamic and things change everyday now
The change is really fast or swift

Though it frustrating but at the it worth the stress and frustration. May God crown our effort with good success. Do have a wonderful day

I know that you can achieve a great result out of this just keep of fighting @geekgirl

maybe you need a break. maybe after a vacation you will have a breakthrough.

I believe sometimes you should probably focus on being productive done making it very perfect. I've done a bit of Android studio for three years so totally understand your point. Even without bugs there can be later problems so overthinking it is normal

Coding can be overwhelming, and sometimes you're just lost for creativity. Taking a break might just do the magic

Yes, exactly.

Ugh, being stuck is no fun at all. I have a couple of website projects that I am avoiding digging into, because I know it'll be a whole lot of time PLUS, it'll be a reminder of what my past self thought was perfectly fine...but totally isn't. Less than stellar design or plugin or functionality choices. Ugh.

Here's hoping you soon find yourself on the other side of stuck into a world of unstuck.

Yes soon, hopefully. Thank you!

I feel your pain. Old libraries stop building and things break when you didn't change anything!

I'm also needing to rewrite all of @v4vapp even while it's all working.

Yes, I don't like when that happens.

It is frustrating after trying to complete something and still find myself don't finish anything.

It may seem we are going around the circle, but usually turns out we are moving up the spiral.

Having tests in place before the refactor helps a LOT for these situations, having them can also help with forcing you to write cleaner code in the first place.

I feel you, dear. I'm also having the same course which I found the coding frustrated sometimes, especially when you get multiple errors. But keep it up. I know you can do it. 😊

It is true that this work is very difficult, my friends also do it, so they are telling that if one mistake is made, the whole work has to be done again.

Good article and quite interesting.

I am proud of you for working out this problem as much as you have, and putting as much care as you have into it.

I think you are overthinking the outside factors. Trust yourself that you wrote code to account for most outside factors. I feel like you are really on the edge of figuring out what it is. And you'll know which direction to take when you just relax into it and know that it's good enough. I think it is likely that the code is better than you think. You got it right this time. Trust that.

Yes, I am leaning it has to do with overthinking as well. I decided no to think at all.

No thinking! You are super intuitive. Trust your gut!

It's tough. I have had that happen before but I tend to think it's better to leave things as they are unless you plan on making major changes or if other people are working on the project. It reminds me of the time when I was working on a project and how horrible it was to merge branches together with other people's code.

Yes, I will let it be for now and wait for the right moment.

This may be sad though. Trying out something and it isn’t going how you want it may be draining
Sorry about that and I hope you get it done
Maybe it’s teaching you or helping you to praise on how to face tougher challenges

It does sound like you're overthinking. It's always a balance. There are projects where I've spent way too much time making sure it would be more flexible for the future but ended up never needing to add any of the functionality I had anticipated.

If it's working now with the refactoring you've already done, I'd say ship it as is and leave some comments in the code to remind yourself what your plans were. Then walk away from it for a little while, not necessarily 2 years but give it a week or so. Just let everything process on a "background thread" in your mind and eventually you'll figure something out and want to come back to it.

Coding sounds like a challenging yet rewarding process! It can be tough, but the long-term benefits are always worth it. Keep pushing through!