DEV Community

Karthikeyan
Karthikeyan

Posted on • Updated on

Why data structures and algorithms are important for frontend?

So in this blog, we are going to discuss why data structures are important.

Yeah, I'm currently learning data structures and algorithm properly. So I decided to write a blog on this topic to improve my journal and understanding.

Myself a frontend developer as like everyone I thought frontend developer don't need to learn how to write efficient code. But after realizing my mistake I thought I should give a shot to learn DS and Algo. Because the important part of writing efficient code is using perfect data structures and choosing which algorithm.

So Now can discuss, why it even matters in frontend development?

In the old frontend, development peoples are built sites that are statically rendered the HTML from the backend. But now the frontend development is more evolved than before everything is rendered in frontend(browser) and the backend is calling only for data pulling.

You may ask like this why I need to code efficiently? Still, I'm solving most of the business problems with my current knowledge.

If you think you don't need it means you didn't involve in the complex tasks.

If you have only 10 list items in your list view page. Yes, you don't need to code efficiently because in the worst case also the site will run smoothly.

But imagine you need to display 50 list items per page and each item having many more interactions and you need to implement a very good UX to the whole page. Yes, you definitely should know algorithms practice to write efficient code.

As a front end developer, I have faced so many performance issues because of re-rendering and other things. For solving those problems we should be strong DS and Algo.

filter vs find

One of the examples for finding particular data is a filter and find. So what is the difference between them?. the filter will do filter the whole list item and returns the expected items as an array. But find will search the list items and returns an expected item when it's found out and then stop the process. This is a major difference. Likewise, there are so many things to know to write efficient code.

So, it's always better to know what DS, Algo and how can we use it to write efficient code.

It's really fun!

And more than everything if you are the one who loves code and solving problems and here warm welcome. It's really more fun than anything.

Improving skills definitely

Solving problems will definitely help you to think logically and efficiently you can learn any technologies at any time but those thinking and logical skills will come by more practice. More practice will give more feed to your brain.

Coming in interviews also!

This is for sure! Most of the top tech companies will ask their questions from DS and Algo from the first round itself.

I lined so many blogs related to how to write efficient code in frontend development. So, don't forget to follow me in this community.

If you find any mistakes in this blog, feel free to point out in the comment section.

Top comments (0)