DEV Community


Posted on

Why Data Structures?

So, do you often wonder why one needs to know data structures in order to achieve ANYTHING in the software world? Well, I do. I always have.. especially because I am not from a CS background and I still aspire to work as a software developer in top product based companies. Is this like chasing a moving target? Like wasting my time may be? Umm, I don't think so. Lets See why -

In 2014, when I just started working as an SE, people asked me - you don't know what is the complexity of running a BST? and I was like umm no, never had to use it to build a website. Although that was true, no one was convinced that Data Structures and Algorithm is a subject you can skip at any level if you are a developer. Most of them were obviously people who had studied formal Computer Science courses for 4 long years!
Now, 3.5 (relevant) years into web development, I am no longer just creating static websites (thankfully! :p). I now know what goes into building what we often call a "dynamic website/portal" that handles real time data, where the data comes from, how does it get displayed/updated on the page, how does one make sure the website performance is optimal and so on. Finally, I have come to terms with the fact that there are certain concepts like Data Structures and Algorithm, time/space complexity, browser performance basics and many more that are a MUST HAVE for a programmer who aspires to grow or be on par with his/her peers. Before I started doing web development, I used to work extensively on Linux. Never knew that a lot of its commands are nothing but data structures at a very basic level! And as you grow in this field, you realise that software development is not just about what you do, its more about WHY and HOW. Why did I use this logic and not the other one, why did I choose to parse my JSON in a certain way as opposed to another, why did I search for an element using this logic and not that one etc. All this comes from a place of experience and CS basics (again, mostly Data Structures and algorithms). Knowing how to do something VS how to do something more efficiently is what makes a difference at the end of the day in the programming world (and in life too!). Again, you will ace the latter only if you know why solution A is better than solution B, if you can also prove it with technical terms, and here it is: TIME COMPLEXITY! Its like there are so many ways of searching for a book in a library. But which one saves more time and how? Because time and memory (or space) are 2 very precious gems in the software industry and you MUST know how to save them at any point in time.

Another fact of the matter is that the amount of time and logic that goes into designing a software is much more than what goes in its development. I say this with utmost confidence because I was recently a part of the design discussions for a product my team has built from scratch. It is almost up and running and I know WHY we did something the way we did. While working on the UI development of the product, I dealt with a lot of JavaScript Objects like Array and Strings (though everything in JS is an object, I just want to be specific here). Any function which involved creating/reading/modifying these object was essentially using Data Structures and their algorithms. So knowingly or unknowingly, we all as programmers use Data Structures and their methods everywhere in our code. So, dedicating time in learning about them, will only help us understand our code better and in turn optimise it in the best way possible. Because that is what everyone is looking for in a developer (may be apart from an understanding of HTTP requests).

I have been working on understanding Data Structures using some of the courses available online but its true that unless we actually implement it in our code, we wont be able to ace it because (sadly) mugging stuff up doesn't work here at all (in 2014, I thought it did!).
I would also like to list down some of the courses/links I have found useful in learning Data Structures and Algorithms:

Here's a link to my own repository (it is still in development stage) where I have tried to apply some of what I learned on small problems:

Any more links/courses that will be of help are welcome :)

Top comments (0)