First Language?

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.

1 Like

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++.

2 Likes

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

1 Like

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.

1 Like

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.

1 Like

This link, in my opinion, gives you all the information your son needs for choosing a language.

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.