Help, Confused with language choice

Hello,
I’m new to competitive programming and I’m proficient in Python. Currently, I’m learning by solving problems on the DSA learning series.

I was going through the resources and topics mentioned in the third section (STL) of the DSA learning series.

My question is does my language (Python) really matters when I try to learn these data structures such as Map, Set, etc. When I saw that the resources mentioned in the STL section are in C++ and the majority of the submissions are in C++ or JAVA, It confuses me and makes me think that am I practicing in the wrong direction?

If I follow the DSA learning series with Python is there any essence that I will be missing?

1 Like

Yes, those data structures are incredibly important and you should either switch to a better language for CP or use something like pyrival, which implements those things. Python doesn’t even have most of those data structures (like an ordered set)

2 Likes

Thank you for replying.

By your suggestion and after reading from other resources I’m planning to move to C++ but I’m not sure with my decision since I’m programming in python from a long period of time and I don’t know whether the Jump from python to C++ will eventually help me in improving my problem solving skills and understanding of data structures.

Finally, Is there anything that you would like to recommend from your side if I go for the path of learning C++, like any resources or path etc.

I don’t have resources, really. What I did to learn C++ (self-learned) was just hands-on learning. I gave myself a problem and told myself “solve this in C++”, then used google to help me with anything I didn’t know how to do. Websites like cplusplus.com and en.cppreference.com are good to look at.

The good thing is, because you’re fluent in python, it should be easy (and you definitely won’t “lose touch” with python either), because you already know how programs work and stuff. It’s more of “how do I do this here” than “what do I do”

3 Likes

I think this should be useful for you

1 Like

Thank you @galencolin and @sahai_harshit.
These advice and guidance means a lot for a newbie in the world of CP.

I would just want to say something as well.In python, you can try to use numpy.Codechef supports it.Numpy provides all kinds of advantages that python’s inbuilt function provides but the various datastructures in numpy and methods perform faster.
I don’t know whether @galencolin would support that or not.
From my side,I would recommend learn to code in c++.Teach yourself first the language.Then go for stl.

To be clear, I have nothing against using Python; there are many tricks that can be done to make it on par with C++ in almost all situations. It’s just that these tricks are not beginner-friendly and can require understanding of the inner workings of the language. If numpy is good, use it!

@galencolin no no…I never said that you have any grudges against python…Sorry if my words sounded so…ya as a beginner python tricks may not be known to everyone…

Your words didn’t imply it, I just wanted to say it in case anyone interpreted it that way

I code only in python and that is because I know only python.
But sometimes I regret doing cp in python.
Most of the difficult problems have 0 submissions in python.
Also many platforms like codeforces do not have time multiplier for python thus leading to tle.
Editorials are always published in c++ never in python.

Python is a great language but not suitable for cp.

3 Likes

I feel the same. Most of the codes of difficult topics are available only in c++ on internet.

Python is definitely a great language to start coding but in long term it wont be so beneficial keep your python skills safe for learning Machine learning or something like that. For competitive programming may be you should go for C++ or Java. To start with c++ check these

I am of the opinion that if the community feels that python is not suitable for cp, then why do they allow it???I do not understand.If u support a language ,at least editorials should have code for that language…or is everyone waiting for innovation for some python coder for cp to take place ???

Many people including me started cp to learn a language, thus all languages are allowed to code in.

You have posted this link in 3 different threads now. Kindly stop spamming links.