DEV Community

Cover image for I'm happy that I'm not always happy with my code
Miguel Rodriguez
Miguel Rodriguez

Posted on

I'm happy that I'm not always happy with my code

This year has been amazing for me, even though I graduated as a Biomedical Engineer, I had the opportunity to enter to the world of programming, and discovered my true passion developing mobile applications as an Android engineer, and I have to say... I never tought that I would be enjoying myself so much at work.

As Junior developers, we have to be aware that it's very likely that we're not the smartest (or more capable) people in our office, this is fine, I think that everyone goes through this at some point. We have to use our 'status' as beginners to learn as much as we can from other developers, and of course, from our own mistakes. Use this time in which the company consider you as junior/beginner to try different things and fail, and use this lessons to keep improving.

In this post, I will address how important it is to acknowledge that even in our best work and even on the simplest implementations, there's always something we could have done better, more efficient, more readable, or just cleaner architrecture-wise. This realizaton will make us grow faster and better as developers. Please feel free to comment and/or discuss how you agree or disagree with what I wrote.

Make sure you understood that tutorial

As a self-taught developer I had to learn by watching tutorials and straight up coding. Watching tutorials can be deceptive. Yes, following through the tutorial for some implementation will help you get the work done, but a common mistake that we beginners can make (or at least that I made) is to just copy whatever the instructor is coding without understanding what the program actually does. Make sure you understand what's happening, and if you don't, go deeper and start reading and learning about that method or class that you wrote but have no idea what it actually does. When the time comes that you need to implement something similar, you will know how to do it, how it works, and now you will be able to explore other options and compare them to choose the one that makes your code better in every aspect.

Ever been ashamed of your past work? Perfect. You're better than you were when you wrote that

Do you ever look back to your past work? Some past projects that you maybe didn't finish? Ever had the time to read a bit of that code you wrote? If you have, it's very likely that you've felt ashamed about it (I have). Feeling bad about your past code isn't bad, on the contrary, if you, a Junior deveoper, are able to recognize your mistakes and you feel capable to correct them, then I have good news for you, you're improving. The important thing is to be honest with yourself and learn to acknowledge when something you did was terrible and needs a clean up, or when it was ok and could've been done better.

Read and learn how it could've been done better

Now that you've identified where your code can improve, it's time to start learning! It's very likely that we make the same mistake of implementing a solution fast just to correct or finish some feature, and this will lead us to hating our code in the future, so we can avoid this by checking the correct implementation of things in resources such as Youtube, Stack Overflow, Github, etc. or asking our more experienced colleagues how would they do it, and why. Remember that is important to understand what we're writing!

Pass on what you've learned

Wise words from Master Yoda. Now that you're capable of recognizing and correcting your mistakes, it's time to help other get through them. As Junior developers, we don't always have te opportunity to help out our coworkers since we're not their first option when they need help. But when you get the chance, do what you can to help them out. Being able to help out others out of experience is one of the best things we can do, it makes us feel how we're getting better each day, and it makes our coworkers and managers realize that we are capable of taking on more responsabilities and challenges. And the cycle of implementing, failing and learning shall continue.

There's a way to do it better - find it.
-Thomas A. Edison

Top comments (0)