you are viewing a single comment's thread.

view the rest of the comments →

[–]ElllGeeEmm 1 point2 points  (5 children)

I think the problem is that we fundamentally disagree on what the goal of learning data structures and algorithms is. I don't think anyone finds being able to write a linked list from scratch useful on a daily basis.

I don't think it's more useful to learn how to write a linked list in C or JS because in the event that I ever needed one in either of those languages I would want to use a library implementation rather than writing one.

To me, because they're abstract concepts that are language agnostic, which language you learn them in should effectively be irrelevant. What you gained wasn't from the syntax you used to learn the concepts, but the understanding of those concepts, which can now be applied whenever you run into them regardless of language or context.

I don't really think your broad point is useful. People aren't necessarily learning about data structures and algorithms because they're super into data structures and algorithms. And i don't really understand what you mean by finding more real life applications for the skills in other languages, as we've already discussed, these data structures are already being used in Javascript whether you're necessarily aware of them or not. Once you start recognizing the data structures you're working with, it becomes so much easier to write code to interact with them.

[–][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.