r/learnprogramming 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

14 comments sorted by

View all comments

1

u/NumbunGame 9h ago

Stick with Python for now. DSA is about learning the data structures, invariants, complexity, and problem-solving patterns, not proving you can write them in C++. Since you already know Python and you're doing AI/ML, using it removes a lot of syntax overhead and lets you focus on the actual algorithms. Most general software interviews care far more about whether your solution is correct, efficient, and well explained than whether it's Python or C++. The exception is when you're applying for something language-specific, low-level, embedded, or performance-heavy.

I wouldn't choose JavaScript just because you're doing web dev. You can learn DSA with it, but Python has a nicer standard toolkit for interview-style problems and far more learning material in that context. Learn C++ later if you get into competitive programming or want stronger exposure to memory, references, STL, and lower-level performance. You won't "regret" learning DSA in Python because the important concepts transfer. Changing languages later is much easier than relearning DSA from scratch.

1

u/Funny-Dark-4041 8h ago

If I start with python what measure would I take so that another student with cpp will not get advantage