In fact, USACO gives 2 seconds time limit for C/C++ and 4 seconds for Java / Python. Although Java has extended time limits, it is still a lot slower than C++ (see here for more details). There are algorithms for problems like Wormhole Sort and Teamwork which would pass in C++, but time out in Java.
Where did you get that Java canāt get full for Wormhole Sort or Teamwork?
I think what he was trying to say is that java barely passed.
Ahhhh, ok, Iāll just sorry to Benq and jessechoe10. Sorry. But, you guys were also kind of mean. Like, bruh, itās true that Java is more intuitive, thus, probably easier to learn without any outside help, then Benq needs to say, āyour biasedā. Like wth Iām stating facts.
Weirdly my mom did recommend C++ a while ago, my point to the parent was that, beginning in Java is much more easier.
Iām switching to C++ after I pass Silver. Also, most school courses code in Java and thereās a reason for that you know.
Donāt take this the wrong way, but you werenāt stating āfactsā. You were stating opinions. Also, you said you werenāt biased, but then said some very biased opinions. Like for me (and I presume for many other people), longer code is a bit harder to understand than compared to shorter code. Also, when you demonstrated how to print out an array in java and c++, you chose the harder way to do it in c++, when in fact it looks pretty much identical. You canāt really say something is harder than something else when you even havenāt done one of them. However, you did have some valid points. Java is more humanoid than compared to c++.
Ok, I get that C++ is shorter. Maybe my writing is terrible, but I said that by easier to read, I meant more like human language. I wrote that way up above.
Isnāt this an opinion?
āMore like the human languageā is also opinionated.
Honestly, I 100% agree with this quote.
I mean, isnāt Java a high level language than C++ā¦ I mean like, if Iām not wrong, if a language is higher language, itās farther from machine language, so I meanā¦ also, I donāt know about C++, but Java methods are really straightforward. Maybe C++ is too, but literally, you can tell what a method does from its name. BigInteger.add(x,y). Very easy to understand. Also, we have to think in the kids perspective. His parents canāt really help, so I mean, I think(opinion) that a more human like language can help. idk
you know, I already saw this right. lol. my gmail pings me. Not very effective honestly. Itās true that Java is high level then C++, and if Iām not mistaken, pretty much it means farther from machine language and closer to English. So, Iām just pointing that out. Also, everyone here is super biased too. If you knew nothing about programming, would cout be easier or System.out.print be easier to understand. I donāt think anyone could guess cout means character output.
I moved it over to the first quote since itās a waste of replies to put them in two separate.
c++ is objectively better in cp
i think he should stick to python and switch to java/c++ when he gets to Gold.
Fine, Iāll give you that. But, if you are in his shoes, you would want something easier to learn. Maybe C++ was easier for you to learn, maybe it wasnāt, but if you were moving from python, java is much easier(I think). When I switched, my mom gave me C++ or Java. I memorized the necessary Java syntax in one day, but C++ I was on the fence. Itās different for every person. The thing is, python and java are probably more related than python and C++, bur Java and C++ is an easy transition. So my whole point in the postās is that I recommend Java because itās an easier switch syntax wise.
I personally would say that Python should be avoided especially for USACO where speed is quite essential. As for C++ and Java, they both are very good languages. In my opinion Java is more friendly though it is substantially slower than C++ because how the code is run. However, Java programs get allocated more time so it really isnāt a problem until you get to gold/platinum. I would go with Java if switching but at the end of the day, it is personal preference. If you like Java syntax more, then go with Java, if you like the C++ way better, then go with C++. It doesnāt really matter especially when you are starting out.
Like many others, I transitioned from Python to Java and then to C++. Though Python for CP may be a bad idea after Bronze, either C++ or Java is fine for USACO and there is really no difference. The problem-solving is what matters and requires much more emphasis.
Iām also looking for first language for my daughter whoās in 8th grade. She skipped 2 grades in math and is taking Geometry in school and doing math competition (AMC, MATHCOUNTS). She has no coding experience and was a little intimidated. I know the guide says to choose C++ if you have no coding experience, but would Python be easier to learn for a first timer? I donāt want her to have a negative initial experience with C++ and then lose interest.
TIA!
Python is only a temporary language for CP. You would want to choose C++ of Java for a more permanent language. I would say C++ over Java as per my opinion.
Would C++ be too hard for someone whoās new to coding? Iāve heard that Python is very beginner friendly.