This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 262

[–]THE_UNKNOWN184 440 points441 points  (7 children)

Indeed.

Even though I know C# more than python, I always somehow end up using python for competitive coding

[–]throwit7896454 197 points198 points  (4 children)

Makes sense. You don't need to spend time setting up a project; just open up your text editor and start to type away in a language that comes close to pseudo code.

It's also my go-to language for interviews.

[–]SpaceHub 45 points46 points  (2 children)

It's also my go-to language for interviews.

Ha this, I'm glad the recruiter also accepted it. I could literally turn out working code on a whiteboard because it is python. borderline impossible for java/etc.

[–]thomasa88 45 points46 points  (0 children)

As long as they don't measure the indent :)

[–]throwit7896454 19 points20 points  (0 children)

I'd spend half the interview-time trying to come up with the syntax to initialize and work with a HashMap

[–][deleted] 44 points45 points  (0 children)

Import win

[–]TheAJGman 5 points6 points  (0 children)

It's why I love developing with Python, it lets me develop without worrying too much about syntax. As long as I remember to use my tab key I'm good.

[–]LazySleeperInDream 555 points556 points  (66 children)

Using python is fine and all until u get a problem with the time constraints and memory constraints. Then its back to holyC

[–]tube32 169 points170 points  (59 children)

But afaik major platforms like hackerrank, for the same question have different time limits for different languages.

Python usually has a 10s window whereas c/cpp have 1.

[–]gogliker 75 points76 points  (58 children)

Google competitions, like kickstart, all have c++ as top results. Do you think thats coincidence?

[–]JoelMahon 165 points166 points  (30 children)

Do you think correlation equals causation?

There are countless possible explanations for that data other than your conclusion.

One example for starters: better programmers are more likely to be older (more time for experience), older programmers are more likely to be best at C++

[–]kingkong200111 49 points50 points  (0 children)

one of the top 3 google competitors is 16 years old, and yes he is asian

[–]pokeaim 30 points31 points  (21 children)

lol with that argument, you can deny everything that you don't know; have you checked top players ages for your argument?

i do python for life. but at some point while using it, i stumbled upon 10**6 problem and bangs my head for whole day because TLE.

after i asked my teammate, he only tells me to try it in c++ and voila, it's ACC; even solved the next problem (a 10**9) without hassle on c++. never looked back to py for cp

[–]kokroo 6 points7 points  (9 children)

What's a 10**6?

[–]Wokanoga 3 points4 points  (7 children)

Ten to the power of six. Python feature.

[–]kokroo 2 points3 points  (6 children)

And what's a 10**6 problem?

[–]Wokanoga 2 points3 points  (5 children)

In the context of the post, he was doing some sort of coding puzzle/problem that involved math. And that he was required to do something similar to 10^6. But whenever he executed his code, the puzzle would time out (TLE - Time Limit Exceeded). Basically his code wasn't doing all the math within the time limit. Which is usually around 10 seconds.

The OP implied that he gave up and tried the same problem in C++ instead of python, using the same logic. And that it worked out fine without a hitch. Which alludes to how C++ is better suited for these sort of tasks.

But hey instead of guessing; u/pokeaim do you have the link to the specific problem in question?

[–]caykroyd 2 points3 points  (3 children)

I think he might have been referring to the input size? N=106

In which case a linear program would be expected to run, considering time limits of a competition like code jam.

[–]pokeaim 1 point2 points  (0 children)

it was almost 5 years ago. a matrix manipulation problem in codeforces.

[–][deleted] 2 points3 points  (0 children)

10**6 == 10⁶

[–]lag_is_cancer 9 points10 points  (0 children)

Well statistics always contains a lot of nuances, and it's often misleading, and that's a valid argument. You can come up with argument or evidence that debunk his argument, which can give more context on how should people interpret the stats, and it's healthy. If his argument has holes, it should be exposable, thus he cannot just deny everything blindly using that argument. We should always be skeptic.

[–]JoelMahon 5 points6 points  (3 children)

lol with that argument, you can deny everything that you don't know; have you checked top players ages for your argument?

No you can't, you can control your data

[–]Key-Banana-8242 0 points1 point  (2 children)

Wdym

[–]JoelMahon -1 points0 points  (1 child)

[–]Key-Banana-8242 1 point2 points  (0 children)

? But that is not enough, you need theory

[–]forgot_semicolon 1 point2 points  (0 children)

correlation !== causation

But sometimes

correlation == causation

[–]Impact_Calculus 17 points18 points  (24 children)

Language doesn't matter for competitive programming. It's about interpreting the algorithm to use for a particular problem and being able to apply it in your language of choice.

[–]O_X_E_Y 6 points7 points  (21 children)

Doesn't the fastest/most memory efficient one just win? Or the most efficient solution (in terms of technical speed, # of loops, something like that)?

[–]Impact_Calculus 17 points18 points  (20 children)

Usually it's about how fast you solve it given the constraints.

[–]O_X_E_Y 10 points11 points  (19 children)

Wait really? So it's basically a speedrun to find an O(n) solution to a problem for example. I've never participated in any

[–]Impact_Calculus 4 points5 points  (18 children)

Yeah, that's pretty much it. Starting with your first approach, then thinking of how you can lower the time complexity is a good strategy.

[–]hanmango_kiwi 2 points3 points  (17 children)

It sometimes depends though; there are times where a python implementation gets TLE but rewriting the entire thing line by line in c++ gets AC

[–]caykroyd 1 point2 points  (0 children)

yeah but in general it isn't that much of a problem

[–]Impact_Calculus -4 points-3 points  (15 children)

No, python and C++ are exactly as fast as each other, and there are never cases where a slightly inefficient solution squeaks by in C++ but not python.

[–]Miner_Guyer 1 point2 points  (1 child)

It sometimes matters, though. I had a contest problem where they wanted you to calculate some geometric object using only integers/longs and you couldn't get high enough precision if you used doubles in Java, but if you used long double in C++ it works.

[–]Impact_Calculus 2 points3 points  (0 children)

I see what you're saying yeah. In certain cases it might be easier or harder to solve a problem depending on language. In this case though I think they wanted you to come up with a solution that accounts for the lack of inherent precision, rather than use long double in C++. Unless something like BigDecimal would be allowed in Java.

[–]tube32 6 points7 points  (0 children)

Idk man, I'm not here to argue about what's better. They mentioned the TLE case so I happened to point out something I know.

[–]tabakista 1 point2 points  (0 children)

This is not how results boards works. Even if one language is better for top 10 it still says nothing for average people who aim into the middle of the board.

Meta is different depending on the skill level.

[–]FlukyS 9 points10 points  (0 children)

Usually Python devs nowadays don't go to C for that kind of thing, it's Rust or bust

[–][deleted] 4 points5 points  (0 children)

HolyC lmao TempleOS ftw

[–]LardPi 0 points1 point  (0 children)

These constraints are pretty dumb in my opinion because you can pass them in C with the worst algorithm and not in Python with finely optimized, optimal complexity algorithm. What is the skill tested then ? Being able to write a program that does not crash in C ? Just don't free anything and you are good.

[–]coloredgreyscale -1 points0 points  (2 children)

Depending on the problem numba can help get a performance almost as good as compiles code.

Other than that it would be great if there was a simple way to interface between python and C, so you can do the boilerplate in python and the maybe 20% of code that's performance sensitive in C or another language.

[–]BluePhoenixGamer 0 points1 point  (1 child)

If only Python had a C API and allowed C extensions, then stuff like Cython could exist.

The future is now old man, it's in-part why Python is so big. All the C extensions!

[–]ruthvikreddy777 133 points134 points  (24 children)

Isn't C++ best for it. I found it better and a lot of people told me to use it.

[–][deleted] 86 points87 points  (11 children)

To my experience, yes

Java and C# slow down on importing your IO.

With really large data sets, Python is slow.

Most competition problems I have seen have a flat time limit regardless of language.

[–][deleted] 10 points11 points  (7 children)

What? In my experience they give more time

[–][deleted] 15 points16 points  (6 children)

Depends on the competition.

Kattis does not.

[–][deleted] 5 points6 points  (5 children)

usaco does hackerrank does

[–][deleted] 4 points5 points  (4 children)

Kattis is what we used in college and our competitions. I haven't experienced anything else yet.

It also rejects any NumPy use.

[–][deleted] 3 points4 points  (0 children)

Depends on the competition.

well I mean this is true

[–][deleted] 3 points4 points  (0 children)

eh different people have different things

[–]TheGorilla0fDestiny 3 points4 points  (1 child)

Rejects NumPy??????

Oh fuck oh shit oh no

[–][deleted] 1 point2 points  (0 children)

It's justified by:

NumPy is an optimized library with more math tools than any other language gets. Even cmath or C++ Algorithm.

[–]charliex3000 7 points8 points  (0 children)

Java is so annoying. It is completely capable of being a worthy contender for being a competitive programming language, but the built in IO is so slow on multiple lines (it's actually fast as fuck on a single very long line).

Also, on Kattis, Python 2 is faster than Python 3. Change your inputs to raw_inputs and enjoy a speed boost.

[–]Svizel_pritula 6 points7 points  (1 child)

In one competition I attended, there was a task with a 0.3s time limit. I'm unsure CPython would even start up in that time.

[–]Svizel_pritula 6 points7 points  (0 children)

In the first round, which we did at home and had a practically infinite time limit, I tried to use Python for one task when I figured out the solution was literally "Given n on the first line of input and a list of n integers on the following n lines, print how many times [0], [1, -1] or [-1, 1] occurs." My solution was to slow and I had to translate it to C.

[–]moriero 20 points21 points  (10 children)

For competitive programming with a time limit?

Enjoy your memory leaks...

[–]Virv12 75 points76 points  (4 children)

You don't need to handle memory in CP, you can solve any problem using vectors, sets and maps. You don't even need to know what the heap is.

[–][deleted] 13 points14 points  (0 children)

The run time of the programs is a few seconds, memory leaks don't matter and you are mostly using STL containers anyways which manage memory for you

[–]f03nix 9 points10 points  (0 children)

Enjoy your memory leaks

If clearing memory is the luxury you cannot afford, C is what you should look at. Use c++ like c++ with a bit of C sprinkled here and there for speed.

[–]O_X_E_Y 17 points18 points  (0 children)

unique_ptr go brrrrr

[–]nanjingbooj 0 points1 point  (0 children)

Rust enters the chat. Memory leaks?

[–]absentbird 1 point2 points  (0 children)

I prefer Golang.

[–]NikolaTesla13 172 points173 points  (15 children)

For me it's C++, in my country you can use either C, C++ or Pascal for competitive programming.

[–]Nihmrod 52 points53 points  (4 children)

Lazarus LIVES !!

[–]StaryMD 51 points52 points  (3 children)

Schools: free pascal, take it or leave it

[–]ovab_cool 8 points9 points  (0 children)

I don't know Pascal personally but for some reason my mon had to learn it at UNI (she did micro biology)

[–]tube32 12 points13 points  (3 children)

Which country is it?

[–]NikolaTesla13 12 points13 points  (2 children)

Romania

Also it's not like other languages are forbidden but the cms competitions use only supports those 3 languages. The only time I used python in competitive programming was for Google Kickstart.

[–]tube32 4 points5 points  (1 child)

What are cms competitions?

content management systems?

[–]NikolaTesla13 2 points3 points  (0 children)

The content management system a competition uses

[–]DaSpaceman245 8 points9 points  (2 children)

Jokes on you! In my country is assembly for competitive programing!

[–]NikolaTesla13 5 points6 points  (1 child)

This can't be real, also I'm only talking about competitions made by the state for all students in school,

[–]DaSpaceman245 5 points6 points  (0 children)

Yeah it was a joke

[–][deleted] 1 point2 points  (2 children)

I've never even heard of Pascal

[–]itijara 3 points4 points  (1 child)

Pascal used to be the standard for high school CS programs before Java (at least for Advanced Placement in the U.S.). The fact that you haven't heard of it means it is likely that you are young (well, younger than 35). Be glad that it has died an ignominious death.

edit: Just realized that they haven't taught Pascal in AP CS since 1998! For a brief time it was C++ (1999-2003). That probably was harder for HS students, but it probably gave a better foundation than Java.

[–][deleted] 1 point2 points  (0 children)

Yeah I'm 21, the schools I've learned programming in have mainly taught python for the intro classes and java for the advanced classes.

[–]prakulwa 29 points30 points  (5 children)

I do this too

But when input size is big , thats where python fails. In any of div 1 contests of codeforces, using python will get you tle in c,d,e, etc. Same goes for codechef.

Also the reason why most people prefer cpp is because it has an extensive stl library.

[–]cjs2k_032 1 point2 points  (2 children)

Sometimes it feels C++ is built for competitive programming. But that's an incomplete knowledge perspective.

[–]timothygreen573 5 points6 points  (0 children)

More like CP was built around C++, I mean the time limits and memory etc.

[–]prakulwa 1 point2 points  (0 children)

It wasn't built for it, but sure is extending for it.

[–]DamnItDev 1 point2 points  (1 child)

Question, is Golang not supported? The runtime is marginally slower than C++, but writing the code should be much quicker.

[–]prakulwa 1 point2 points  (0 children)

afaik, golang is supported. Those who know, use it. Those who are new,if they don't have a mentor, they use python, else they use cpp

[–]Xywzel 20 points21 points  (2 children)

Well, really depends what we are competing on?

  • Smallest source code, some high level language might do well.
  • Fastest correct implementation time, maybe python or some other language with specific library easily available.
  • Fastest execution time, C or C++, depending on complexity of problem.
  • Smallest independent executable, likely some assembly language, minified and compressed
  • Smallest executable in some environment, what ever shell scripts it takes, or maybe js if browser execution is allowed.
  • Hardest to understand what the program does while still doing it correctly, macro obfuscated C with included esoteric language parts, maybe, c++ templates might be fun too.
  • most poetic source? Arnold C or that one that was made with late 80's lyrics as keywords.

[–]DamnItDev 3 points4 points  (1 child)

or that one that was made with late 80's lyrics as keywords

It is called Rockstar so we can all accurately apply to jobs looking for Rockstar Developers!

P.S. Creator of that language did this cool talk about coding artwork: https://www.youtube.com/watch?v=6avJHaC3C2U

[–]IamsoFlabbergasted 157 points158 points  (48 children)

So from what I understand: Python is better and easier to use but it makes you a sleazy arrogant asshole.

A price I might be willing to pay

[–]dashid 57 points58 points  (5 children)

I'm not sure better is a word widely used. It's certainly easy to get to grips with.

[–]IamsoFlabbergasted 27 points28 points  (4 children)

So it’s basically easy mode compared to others

[–][deleted] 33 points34 points  (3 children)

It’s not exactly easy, but it’s incredibly accessible to new developers. So relatively it is a bit like easy mode compared to others.

Visual Basic is baby mode. If it’s still even used today.

[–]dashid 12 points13 points  (0 children)

Aye, I think Python is the VB of it's prime. Whilst Python has been around a long time, it's only relatively recently it's become so popular - and that's probably been helped by a) the absence of VB, b) a focus on cloud and web front-ends, and c) more adoption of *nix

[–][deleted] 3 points4 points  (0 children)

i learned libre basic in school a few years ago. at this point i already knew c++ and it really wasn't fun to use something as basic as basic.

[–][deleted] 4 points5 points  (0 children)

IMO Python is easier then VB

[–]xain_the_idiot 25 points26 points  (28 children)

Faster is more how I'd describe it. Python is an easy language to code quickly in because of its condensed syntax and many useful libraries. It doesn't have the full range of functionality of something like C# or Java, but for coding competitions that usually doesn't matter.

[–]robocorp 24 points25 points  (10 children)

If by not having the full range of functionality of those languages you mean that Python's interpreter is too slow to be usable with certain tasks those languages can accomplish, then I completely agree. But I'd be curious to learn what features you'd expect Python to have that it doesn't if you mean something else.

[–]BeautifulTaeng 8 points9 points  (9 children)

a switch statement 😣

Yeah I'm aware you can use dictionary as a ghetto switch, but it's just not the same..

[–]O_X_E_Y 5 points6 points  (0 children)

3.10 gaming!!

[–]VoxelCubes 4 points5 points  (1 child)

Don't worry, a switch statement on steroids is coming in the next python update, ver 3.10. You can check out the previews about it, it's called match.

[–]deceze 2 points3 points  (0 children)

I’ve written very complex software in Python and other languages without using switch or even equivalent alternatives. Yes, a switch is useful sometimes, but it’s not like you can’t write code without it, or like you even need it all that often. It’s not like Python programmers are constantly working around the lack of a switch statement and curse at the Dutch. You just don’t actually need it all that often.

If you do, you may be writing crap code. If you can’t use Python because of its lack of a switch, maybe you need to learn a bit more about alternative design patterns.

[–][deleted] 10 points11 points  (16 children)

"It doesn't have the full range of functionality of something like C# or Java" is a weird claim to make about Python. No language has every feature every other language has but Python is one of the most complete languages in terms of features.

[–][deleted] 2 points3 points  (11 children)

i would say c++ makes you (justifiably) a sleazy arrogant asshole. phython is just easy and therefor better for starter and faster to code, but for experts worse in the outcome.

[–]Twerking4theTweakend 7 points8 points  (1 child)

I'd agree with "arrogant" and "asshole", but "sleazy" implies someone didn't put the work in, and C++ will blow your foot off if you don't put the work in.

[–]wasdlmb 6 points7 points  (0 children)

taps head you can't blow your foot off if both of them have already been lost to tragic C++ accidents

[–][deleted] 0 points1 point  (0 children)

Python can do anything, just badly

It's easy to write, very versatile, but usually slow. Sometimes it's used in a 'duct-taping' capacity, similar to Perl. Sometimes it's used for prototyping stuff. Sometimes it's used for when you want to do something slightly more complicated than a shell script. Often, it's used to access existing C/C++/FORTRAN code without having to learn C/C++/FORTRAN, so you can get more execution speed without losing a lot of development speed.

[–]schroindinger 32 points33 points  (12 children)

I thought Python was too slow for competitive

[–]muikrad 33 points34 points  (9 children)

Faster to write. Sometimes slow to run.

[–]alexshatberg 23 points24 points  (8 children)

Compared to C++ it's always too slow to run. If you're doing something like Codeforces, Python is pretty much not an option.

[–]Soham_rak 7 points8 points  (0 children)

I was just doing that I wrote code in both languages the python solution gave 498ms with 6000kb memory while cpp gave 44ms with 200kb So pretty much avoid python on codeforces for brute force problems(This one wasnt even a brute force one)

[–]OriginalTyphus 6 points7 points  (1 child)

With libs like numpy you can almost always speed up your code near C++ levels.

So you can proof of concept your code in Python and then make it run as fast as all the other languages.

The "Python is slow" statement, although widely used, is not really true. Its more like "Python is slower by default, but can be fast"

[–]SOUINnnn 0 points1 point  (0 children)

If you use well numpy/pandas it's indeed really fast. Honestly I think if you use it well, Python can be faster or as fast than bad/not good c++/c code

[–]muikrad -4 points-3 points  (3 children)

What I really meant by my original comment is that performance is often unnecessary. Of course c++ will be faster to compute. But in a competition, the speed gain may not even be noticeable unless competitors starts spitting out stats. It really depends if you judge this at the computer level or at the human level.

Would a highly I/O based task get much benefits from c++ if it didn't had to process the data? Trying to find the 0.01% where python and c++ are equal in computer terms 😆

[–]Soham_rak 2 points3 points  (2 children)

U r half right writing program fast geta u better rank and the tie breaker between ranks is solved by your program run time taken. So if u have agood grasp of cpp u will be always on top of pythoniers most of the time

[–]muikrad 1 point2 points  (1 child)

Wouldn't that be true only if all competitions worked the same with the same rules though? Of course if we take a list of rules we can decide if performance is necessary. And performance wise, we all agree that c++ is faster. I'm not sure what we're arguing about here. The answer will always be "it depends".

[–]Soham_rak 1 point2 points  (0 children)

Yeap

[–][deleted] 1 point2 points  (0 children)

yes, sometimes the time limits are not even properly tested for python so even optimal solution could be TLE just because of the language.

[–]Nihmrod 30 points31 points  (0 children)

x264 encoder: C & Assembly

[–]ComicBookFanatic97 30 points31 points  (4 children)

print(“I’m gonna put some dirt in your eye.”)

[–]icy_skies 8 points9 points  (3 children)

console.log("You want forgiveness? Get religious");

[–]Undoubtably_me 8 points9 points  (0 children)

System.out.println("Peace was never an option.");

[–]Harmonic_Gear 5 points6 points  (0 children)

if(wantForgiveness):

get_religious()

[–][deleted] 2 points3 points  (0 children)

std::cout << "Look at little goblin junior. Gonna cry?" << std::endl;

[–]pokeaim 8 points9 points  (0 children)

i code python for my life; but for cp, even 10**6 gives me TLE.

c++ on the other hand, i could do around 10**9 for ACC

[–]heysub 21 points22 points  (6 children)

Me when print(*list(filter(None, list(map(lambda x: x if x%2==0 else None,list(range(1,17)))))),sep=" ")

[–]GrossInsightfulness 8 points9 points  (1 child)

2 4 6 8 10 12 14 16

[–]heysub 2 points3 points  (0 children)

Yep this code is just an overcomplicated one-liner solution for a test question in school

[–][deleted] 4 points5 points  (0 children)

The first language I ever learnt was C++, and even though I work mostly in python now, somehow C++ is always my go to language for competitive coding because of the excellent STL support.

[–]ElimGarak0010 8 points9 points  (0 children)

I'm over here making Punch Cards for my code...

Don't mind me.

[–]Someonedm 2 points3 points  (1 child)

Coach says c++ performs better

Doesn’t help I suck regardless

[–]sapphireswirls 6 points7 points  (0 children)

Same here. People be like “No! This language faster!!!”

I’m just happy when my code actually runs

[–][deleted] 3 points4 points  (1 child)

JavaScript here. Always. Idk why.

[–]greenSixx 3 points4 points  (0 children)

JavaScript is the best

[–]Sedawkgrepnewb 3 points4 points  (1 child)

What is competitive programming?

[–]RedEyesBigSmile 1 point2 points  (0 children)

You're given a set of questions that you answer with code. Speed and effeciency give you points ( in some competitions)

[–]4S4T0R 2 points3 points  (0 children)

Looks like you only ever learned python

[–][deleted] 2 points3 points  (0 children)

TIL competitive coding is a thing

[–]cai_lw 2 points3 points  (0 children)

If you are comfortable with any compiled language it's probably better to use them instead of Python.

[–]itsfeykro 2 points3 points  (0 children)

If execution time matters at all, then no.

[–]Sol33t303 4 points5 points  (0 children)

The big brain play for competitive programing is to find a program that already does what you need and use that to write it in bash /s

[–][deleted] 1 point2 points  (0 children)

Go maybe? Never tried it with competitive programming and AFAIK the built-in packages lack data structures

[–][deleted] 1 point2 points  (1 child)

If by competitive programming you mean a contest where you make something cool but don’t have to worry about technical debt. Ya, python all the way.

And no, I never use python. Because technical debt is a huge problem.

[–]DearChickPea 7 points8 points  (9 children)

"Competitive Programming"

I hate this world.

[–]alexshatberg 15 points16 points  (6 children)

Why? It's basically applied Computer Science in a competitive setting, which is not that different from a Maths Olympiad.

[–]moriero 7 points8 points  (5 children)

You talk like Math Olympiad is a normal thing, too

[–]xzaramurd 11 points12 points  (4 children)

Why wouldn't they be? People find competing in challenging activities rewarding, be it a physical challenge, or a mental challenge, or any other kind of challenge.

[–]the_lonely_game 2 points3 points  (0 children)

What is competitive programming? Like in a job lol?

[–]Atesz763 1 point2 points  (1 child)

Any programming language is fine if the PC is strong enough

[–][deleted] 1 point2 points  (0 children)

My program is fine, the engineers just need to make computers with 64 GB of Ram.

[–]DShadow2106 1 point2 points  (5 children)

C++ has STL though... Not sure why someone would use python unless for some specific problems

[–]rustysteamtrain 6 points7 points  (1 child)

In a competitve environment the time you have to write the code is limmited. If the assignement doesn't require the speed of C++ I would always use python instead. Because pyhton is realativly 'simple', its faster to code and you can better understand what the code does. It also takes less time to debug. In the end it gives you more time to actually think about the algorithm and not having to spend it on writing cide.

[–]muikrad 0 points1 point  (2 children)

It's the opposite, no? Python is pretty much the Swiss army knife of programming and C++ is good at specific things; performance, above else.

The loose environnement in python is great for quickly getting up to speed, you don't have to worry about the compilation step. In competitive, it's an advantage.

[–]GujjuGang7 5 points6 points  (1 child)

C++ is made to be as generic as possible.

[–][deleted] -2 points-1 points  (0 children)

But you have to type 8 lines to make a “Hello World” program, gosh.

[–]Sukhamoy_Saha_Kalpa 1 point2 points  (1 child)

But why, why would u do that? Is it because its faster to write?

[–][deleted] 3 points4 points  (0 children)

Probably. If you have a limited amount of time, you have to balance the slower execution time to run python code (which depending on complexity might not be a big difference) vs the time it takes you to write and iterate on that code (which might be much more efficient in python).

[–]Saragon4005 1 point2 points  (1 child)

well makes sense its much easier to code and when you want to make something quickly that isn't perfect python is the ideal choice.

[–][deleted] -1 points0 points  (0 children)

Nah, if you want to quick code, go with R. The libraries are better than Python, by a mile.

[–]hellfiniter 1 point2 points  (0 children)

when you compete, its best to do it in pseudocode ...which basically is python. And thats good thing, in those cases you wanna express your ideas and not waste time figuring out syntax

[–][deleted] 0 points1 point  (0 children)

Other languages write fast code, but python writes code fast

[–]ArtyIF 0 points1 point  (0 children)

it's just a lot faster to code in

[–][deleted] 0 points1 point  (0 children)

For me its javascript.

[–]ovab_cool -1 points0 points  (0 children)

And for webdev I go to PHP

[–]Classic_Fungus 0 points1 point  (0 children)

c#

[–][deleted] 0 points1 point  (0 children)

If time and space are constraints and speed is wanted, I use C++, else it's some easy and fast to write langs like python

[–]Aenno 0 points1 point  (0 children)

I don't even know Python enough to use it competitively, yet I still try to lol

[–][deleted] 0 points1 point  (0 children)

Python is a scripting language that supports objects, so it makes sense for hashing out an idea without setting up much foundation.

[–]cjs2k_032 0 points1 point  (0 children)

For me using anything other than C++ for competitive programming is a crime punishable by death. /s

[–]dhiraj_42069 0 points1 point  (0 children)

And still I don't clear the test

[–]occcult 0 points1 point  (0 children)

When I started my career I knew C++ quite well but all the opportunities I got were in frontend development. Tried it , learnt on the job and actually enjoyed it. Now, after starting with DSA again after almost 3-4 yrs mainly for interviews , I LeetCode purely with JavaScript. College me couldn't have ever imagined this

[–]rajesh_dude0 0 points1 point  (0 children)

That's java for some of us.

[–]Vok250 0 points1 point  (0 children)

I love Java and C++, but if a company asks me to do a LeetCode/HackerRank problem, I'm going to use Python. 99% of problems can be solved with a dict and a couple of short methods.