Algorithms! Oh how we love them! What even is an algorithm you say? Well, if you don’t know it is essentially a scalable solution to a problem in code. It could be a mathematical problem which predicts your chances of being ill if your temperature is high, or it could be something that procedurally generates a universe in a computer game.

Before switching to programming, I was a professional pianist. I used to practice patterns and structures, also know as scales, very regularly. They were part of the building blocks of all western music and kept my technique sharp. When I switched careers, I replaced scales with algorithms. Yes, I actually practice algorithms; a lot.

By practice I mean finding meaningful and creative ways of using the building blocks (data structures and algorithms) to create solutions that are elegant as possible. I make little problems and try to solve them using algorithms. I do this because it seemed like a direct transition for me between scales and design patterns. I’m no expert, but I find that they help me improve on mathematics, problems that involve depth and recurring operations over the same data and they help me understand how data is processed at scale.

I think everyone should practice in programming. What are you practicing right now? To a musician, practice is focussing on areas of weakness, breaking the problem right down and focussing on mastering that one problem, no matter how small. Imagine you really didn’t understand Binary Trees, but you knew they were used to store data in an application. You could apply this technique starting at a very basic level and in your free time you could see it as a little puzzle before it grows into something more complex and interesting.

I practice algorithms because they are actually quite simple and simple things are the scariest.

There’s no getting away from the fact that the simplest things in any field are the most difficult to grasp, and its so easy to skip these focussing more on frameworks, patterns and syntax. Deliberate focus on the small, simple things is the key to depth though, and depth allows you to apply solutions at will, creatively and with synergy.

To summarise, I’m not sure if you study your algorithms and data structures, however I have massively benefited by learning many of them as it enabled me to process what I was reading/doing much quicker as I was used to slowing down and thinking in that manner that programmers so often do. I think it’s very important to do so, especially if you didn’t go to college or university, as if you have a weakness in any area, you should focus on it, fix it and grow from there.

Leave a Reply

Your email address will not be published. Required fields are marked *