Working with code that should be deprecated

Hi all!

Remember this one time where you had first jumped on the code base when you started a job?

Then remember also how much spaghetti code there was and that it could be a lot simpler?

Chances are that the 5000 lines of code to slim down becoming 500 lines will take quite a bit of time and effort to achieve.

However, that’s okay, especially when there will be more time down the future of a project. Nobody should be doomed working with legacy code.

Therefore, a good way would be to introduce a new concept somewhere in the middle of the project.

Here’s an example: I was pretty new to Xamarin, but I’m not that new to Android development. The concept of how things were working gave me a pretty good idea of how the code base kept working together.

I saw some things that definitely were able to use improvements. We had a colleague learning Android development at the time using fragments in order to reinvent the navigation drawer… there was a header fragment to reproduce the hamburger, back button, menu options, etc…, and body fragment for everything which was pretty much overkill. It was quite messy along with the extra classes and variables that were not really needed.

As I became much more familiar with Xamarin’s capabilities, I decided that it was a good time to introduce the CoordinatorLayout along with the real Toolbar. I reused the body fragments that had all the functionality within them. It didn’t take long to do 80% of the port at the time.

Then there came a design change in which the time to make all of those changes for myself weren’t very feasible to do alone. It’s quite fun to see that there were quick-and-dirty solutions in order to achieve all of the possible use-cases that were needed. Therefore for me, it was better to work with what I had in this case.

Time went on and we started adding a couple more people on the project I was solely working on. As resources grew, I started telling someone else also familiar with the concept about what I was trying to achieve. He started to jump on it straight away, while I’m now fixing bugs towards the day of releasing the app. As the app is still in progress, stay tuned for updates!

Anyway, here are some of the takeaways from this experience that I’ve gained:
– You learn other possibilities to try and make something using an already existing concept out there.
– You become very excited about how another person with more experience actually works on what you’ve started and starts to work along with you.
– You just keep getting better each time.

Therefore, don’t cringe and cry on that new project! Just work with it, and you’ll find an amazing experience along the way.

Until next time!

Brian.