I'm currently learning machine learning and improving my skills through Kaggle and personal projects. At the same time, I'm preparing for job placements, which involves practicing data structures and algorithms (DSA) on platforms like LeetCode and HackerRank. I've decided not to use Python for DSA and initially selected C++ due to its implementation in core ML frameworks, its prevalence in robotics and AI, and its common usage in competitive programming. However, I've recently come across a lot of criticism regarding C++, with opinions suggesting it's unsafe, difficult to maintain, and somewhat outdated. This has caused me to question whether committing to C++ is still a smart choice for DSA in 2026 if I'm interested in ML and AI roles. Would Java be a better, more practical option for placements instead?
2 Answers
Honestly, you don’t need to overthink which language is the best to choose. Both have their strengths, and focusing on your skills is more important than the language itself.
C++ is still a solid option for both DSA and machine learning. Remember, people online can exaggerate issues with languages just to hype newer ones. It’s about what fits your style best.

But what about job opportunities in C++? Aren't they declining?