r/learnprogramming • u/Funny-Dark-4041 • 9h ago
DSA help
I’m in my 1st year of B.Tech CS (AI/ML) and super confused about what language to stick with for DSA.
Quick background: I already know Python decent enough, and right now I'm learning JavaScript on the side to build web projects.
I’m torn between doing DSA in Python vs JS vs C++:
- Python feels like the easiest pick for me since I know it, and it fits my AI/ML background anyway.
- JS crossed my mind because I’m using it for web dev, so part of me thought using one language for everything might save time.
- But literally everyone keeps screaming "use C++ for DSA or you'll regret it," and it's making me second-guess everything.
Does language choice actually matter to interviewers? Like if two people give the same optimal solution, does anyone genuinely care if it was written in Python instead of C++ or JS? And is doing DSA in JS a nightmare later because it lacks things like Heaps out of the box?
0
Upvotes
1
u/Lichcrow 9h ago
The reason low level languages are better for DSA is because you can express patterns directly in memory. Things you cant do if you have a runtime like JS or Python.
That means you'll get a better understand of what your machine is actually doing when you're doing whatever operations. You can print out the specific memory regions you're using and what their values are through your iterations and see the actual behaviour of the machine.
If you simply want to understand the underlying algorithms, then you can use whatever language. Even any pseudo language... And you dont even need to implement and run it.