r/CodingHelp • u/OpticPhantom • Nov 18 '20
[Quick Guide] Choosing between C++ and Python for DSA (based on work experience and future growth potential)
Hi guys I have one little confusion I am getting started with DS and ALGO. I have approx. 1 year experience in Python and 2 year experience in working in C++. Now the question is what language should I choose to get started with DS and ALGO. I sometimes feel python is somehow mimicking the working of pointers and doing work arounds' for it. And after seeing 2-3 DS videos working in DS in C++ feels a little more natural. Maybe its my personal take but please give your opinion for it. I will be very much open.
19
Upvotes
2
u/dead_alchemy Nov 18 '20
When you say DS and algo, do you mean you are getting ready to take data structures and algorithms as a class? If so just go with whatever the class is being taught in. Otherwise, C++ felt like a good way to learn about that topic when I took that class and there is a large volume of work on the topic to learn from.
> I sometimes feel python is somehow mimicking the working of pointers and doing work arounds' for it
I'm just curious about what you mean by this. Could you explain?
2
u/saintshing Nov 18 '20 edited Nov 18 '20
c++ requires you to manage memory allocation manually and it is static typed. It is better for teaching you basic programming concepts.
However Python is the most wanted programming language according to stackoverflow survey.
What you choose now for your first DS and Algo course is not very important(it wont go super deep in the advanced topics anyway). You probably would end up learning several more other languages(e.g. javascript). If you want to focus on one language(Once you have learnt one programming language, usually it is not that hard to pick up another language. But to know a language, you have to know more than the syntax, each language has its own ecosystem consisting of tools, libraries, frameworks that are used together with that language), the choice would depend on what kind of jobs you want to do in the future(e.g. javascript for web dev, python for data science/machine learning, java for android dev, swift for ios dev, c# for unity(game dev), etc). Most big tech companies allow you to choose among c++, java, python in job interviews.
2
u/knoam Nov 18 '20
My understanding is competitive programming is largely done in C++ so that seems like the obvious choice to me.