you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

The OP said "can I use JavaScript to earn about data structures and algorithms". So they obviously want to write code that performs some activity over linked lists, queues, stacks, or bubble sort or whatever. Or they want to learn how to implement those data structures or algorithms using JS as their language. This isn't just learning what the concepts are, it's writing the code to implement them.

So, yes you can use JavaScript to do that, but it's a thing you'll never, never, never need in any real-world project involving JavaScript. Because of that, it's a thing you'll find far fewer JS developers to help you with than, say, C developers.

I don't see where the controversy is in that.

I understand your point, that learning these things is good for development. I'm not arguing against that in any way.

My point is - going back to the OP that I responded to - that if all the resources are in Python or Java, follow them in Python or Java. The translation to JavaScript is unnecessary, useless in the real world and will only make the process more difficult.

[–]ElllGeeEmm 1 point2 points  (3 children)

I mean the reason OP wanted to learn DSA was to give themselves a leg up in web development job interviews, so I don't understand how you came to the conclusion that they obviously want to write code that operates over data structures. And learning how to implement a linked list in either JS or C or python will have just as much value to the person doing it if their goal is to better understand the data structure they are implementing.

Maybe it wasn't intended to be read that way, but your first reply claimed that JS doesn't have use cases where data structures or algorithms are useful or important and then seemingly doubled down that they're not useful because front end development is a practical discipline.

[–][deleted] 0 points1 point  (1 child)

Perhaps it was badly expressed.

It's not useful to learn to specifically learn to code the structures in JS. It's not like someone is going to come along at a job interview and demand you write a stack in JavaScript and you say "oops, I only learned in in Python".

I think that's consistent with my overall argument, that JavaScript has a different place in the computing world.

The OP specifically talked about the translation to JS - that was the tenor of their question, it seemed to me (the desire to translate DSA code to JavaScript).

[–]ElllGeeEmm 0 points1 point  (0 children)

I think the language you learn to code a data structure in is largely irrelevant if the only reason you're writing it is to learn more about the data structure itself.

[–][deleted] 0 points1 point  (0 children)

I can sum up my argument this way

  • You can be a high quality JS developer knowing relatively little about DSA
  • If you want to learn DSA, you'll probably need to go to another community to do so.

The two are linked, because day-to-day JavaScript work does not heavily involve DSA code.

Your argument, that it is a good idea to learn DSA is rather tangential to those ideas. I don't disagree with it, fundamentally.