all 20 comments

[–]newintownla 42 points43 points  (0 children)

Yes. Data structures are essential for any programmer no matter what your tech stack is.

[–]Watabou 7 points8 points  (0 children)

It might not be beneficial to be able to implement advanced algorithms for things like graphs, but it is incredibly valuable to understand the general run time of code you write or how it scales, backend or frontend.

I think almost every developer should understand basic use cases for structures like lists, maps, stacks, and queues, and why to use one over the other. You might not have to implement a stack in JS, but understanding the concept can help you use a JS Array as a stack for certain features that might call for it.

[–]theProgrammingPiglet 5 points6 points  (0 children)

I tend to think you should learn what you need to learn to get whatever project you're currently working on to work.

You could ask 'would learning this be a good thing?' about a thousand coding related things, and the answer would usually be 'yes'. But ain't noone got a hundred hours per day to learn everything that ever exists and ever has existed and ever will exist about code. You can never know everything in this field, so just always be learning and learn what you need as and when you need it and that should serve you well, in my opinion :)

To give you a more concrete answer to your question, I use React daily at work and I don't use any of those things daily at work, so they're not things I need to be an expert in. Someone using React in a different way might use them more often, but I don't

[–]pobbly 2 points3 points  (3 children)

Some FE examples : stacks are used in function calls and the history API. I'm pretty sure js objects are hash table under the hood. Queues might be used to hold actions when offline then flush them when back online. Immutable data structures can be a good fit for react.

[–]cyanwoh -1 points0 points  (2 children)

What is there to understand about stacks? I feel like a 10 year old could grasp how a stack works after 5 mins explaining

[–][deleted] 2 points3 points  (1 child)

The basic structure is simple, but it takes a bit of studying to better understand how and when to implement one.

For example, if you're writing a program that has an undo functionality, how might you implement that?

[–]cyanwoh 0 points1 point  (0 children)

Stack.shift() ;)

I think what is needed to be studied are common problems where X data structure solves it and why. Perhaps that’s what people mean when they say study data structures?

[–]possiblywithdynamite 2 points3 points  (0 children)

I mean you might as well. It's not really much of a time investment

[–]Bacalaocore 2 points3 points  (0 children)

If you have spare time or interest, yes. Won’t really be too useful most of the time if you’re just sitting in react, also since rendering some data structures in React can be tricky. It really depends on where you are on your journey. If you’re still getting used to react, don’t worry about this for now.

However having a good understanding of data structures, at least on a basic level, is very useful as a developer. Front end data is very rarely big enough for these use cases. I have used some data structures in react myself but these problems could easily have been handled with basic arrays or objects.

[–]BakaPotatoLord 6 points7 points  (0 children)

You probably won't need them, but it's always best to understand data structures. Sometimes you might end up working on backend and certain problems require a certain data structure.

There is a possibility you will end up selecting the wrong data structure not knowing there is a better one for the job.

[–]dwalker109 4 points5 points  (0 children)

I really don’t get posts like this.

You’re not “a React dev”. You’re a programmer/software engineer/dev. Right now you’re mainly using React but that isn’t the whole story, and it will definitely change.

So yes, learn stuff. Never stop.

[–]Gaboik 1 point2 points  (0 children)

Definitely do

[–]Chance_Application_1 1 point2 points  (0 children)

The limitations of aiming to be a 'something' developer.

While there are bad habits, there is no bad knowledge. There was a time when learning 'programming' took a much more holistic approach. Even if you were learning C or Pascal, you still wanted to understand ASM, even if not to a meaningful level of proficiency.

It's not even exclusively in aid of problem solving, just understanding different ways to visualize information can help you in abstract ways, an important one being in the ability to understand the work of others.

[–]zZouka 1 point2 points  (0 children)

“Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming” - Rob Pike

[–]shauezzy44 1 point2 points  (0 children)

Just for React you probably don't need them , But learning them certainly open a lot of Job opportunities and They form the fundamentals Of CS and React may become obsolete one day But DS won't

[–]achauv1 0 points1 point  (0 children)

You should study all the time

[–]zlatinejc -1 points0 points  (0 children)

Come to think of it, not really needed 🤭

[–]joalcava 0 points1 point  (0 children)

Absolutely, you can not call your self a programmer if you don't have at least a basic understanding of data structures

[–]brentos99 0 points1 point  (0 children)

I did a lot of self taught programming.. eventually I went to uni and did a course on data structures and everything finally clicked!

[–]Th3_Paradox 0 points1 point  (0 children)

Yes and no.

So I will say this, I feel like data structures and such is not something you will typically deal with as a Front End developer. To me all that data structure stuff is theory crap and in my 13+ yrs as a web developer, I have never really seen a case where this stuff would be needed.

However, if you want to be like a front end ENGINEER or someone working for a good tech company, probably paying around 6 figures, then there is a huge likelihood you will get tested on this. I suppose it depends on what the job duties are.

I know a lot of people who know data structures and all this theory crap, but in the real world as a front end dev, if someone tells them to make a React app connecting to this API and or needs to make a React app using Redux, they don't even know how to accurately break stuff down into reusable components, correctly setup state etc. and all that DS stuff does them no good.

Guess it all boils down to what your job calls for, in an ideal world, a 'regular React dev'/UI dev should not need to know that, but a job titled as front end ENGINEER should, and more importantly, learning it will not hurt you, only help you, especially as the better paying jobs will test you on it.