Image created with Pablo

The Importance Of Revisiting Your Old Code

Why Being Embarrassed By It Can Be A Good Thing

4 min readNov 12, 2015

--

As a developer you are constantly learning and improving, or at least you should be (more on this in a future post). One of the hardest things to do is to look back at old projects with your now more experienced eyes and wonder what the heck you were thinking back then. Once you get over the initial embarrassment it can be a really useful exercise to look back at code you have previously written.

You can see how far you have developed your coding skills

You should be looking at your code wondering why you wrote things in such a basic way and easily see how and why you would have approached things in a different way. There will be less of a difference in the quality of your code if you’re already a very experienced programmer because there can be quite a steep learning curve in the first few years compared to a bit later down the track. That’s not to say that when you are more experienced you won’t always be learning and improving, it’s just that the difference may not be as noticeable.

Yang Li, an experienced Front End Developer and teacher at General Assembly, explains an important realisation he had when looking back at previous code, “I remember revisiting my first Angular app and realising that I could have done the same app with half the code. One important thing I’ve learned over the years is that if you can write less code to do the same thing, then do it. Reading code is painful, having to read lots of code to understand the functionality is even more painful!”.

You can implement your new found skills

Refactoring code from your old projects is the perfect way to practice your hard earned coding skills. A common practice when your starting out learning to program in a language such as JavaScript is to just write out all your functionality in separate functions, even if the functionality of these code blocks is quite similar. It can take some further experience to realise ways you can write your code to optimise the reusability of functions and to write it in a way to maximise the extensibility of your code.

A good exercise to test how far you have come can be to test the performance of your JavaScript code using to service such as jsPerf. This is a great way to determine if your refactored code is now more efficient.

Image Source: https://jsperf.com/empty-vs-html2

What happens if your code hasn’t changed much?

It could be time to start learning something new. Check out the latest coding frameworks and find one which interests you the most and get started on that. Another great way to learn is to pick up a tech book and improve your knowledge through a greater understanding of the theory of how a certain programming language works.

Here are some useful links for learning some new skills (please note that I’m not affiliated with any of these sites, I just find them super useful):

NodeSchool — This site offers choose-your-own-adventure style lessons where you can learn how to use technologies such as Node, npm, git and even React by writing code to solve real-world type problems.

Eloquent JavaScript — This book comes highly recommended by a lot of great developers. It’s all available online and has great coverage of modern JavaScript programming concepts.

GitHub — Fork a repository and start working on it on your computer. This will make it easier to go through the inner workings of the code and get a great insight into different coding techniques. You can follow experienced developers on here too which can give you a great insight into how they write code.

General Assembly — Full-time and part-time courses where you can learn skills in Front-End and Back-End Development, as well as Data and Analytics.

This is by no means a comprehensive list but it should help you get started in the right direction.

If you found this useful please recommend this article below. If you want to stay updated with my latest content you should add me on Twitter :)

Do you have any epic refactoring stories or any great coding resources? Let me know in the comments below.

--

--

Software Engineer, Side Project Enthusiast. Run, Lift, Code — Repeat