Java or c++?

Hi! I am completely new to programming. I want to participate in Programming Olympiads(ZIO/INOI/IOI) and competitive programming . I have been doing java for 10 - 12 days and tried c++ for a few days. I read that most people prefer c++ because it is faster and contains STL . However I am more comfortable with Java. Which language do you prefer(Why?)? Is it okay to do Java or MUST I switch to c++ ? I don’t want to study both as that will waste a lot of time and I have less time as the examination is near . Thank you.

C++ :heart:

Hope this clears your doubt:

https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.geeksforgeeks.org/tips-and-tricks-for-competitive-programmers-set-2-which-language-should-be-used-for-competitive-programming/amp/&ved=2ahUKEwiQk8eX_tjrAhVFxjgGHd06D3YQFjANegQIAhAB&usg=AOvVaw0v8qudYNJPZZy3fwdS9Dd8&ampcf=1

hello @cod_e_nthu though c++ is a bit faster and has large stl support still that won’t be suffecient if you aren’t comfortable with it I personally would suggest you to continue with the language that comforts you… happy coding <3

This really helped me. Thank you.

OK thanks . :slight_smile:

Hey @cod_e_nthu … It depends on your end goal… what you want to achieve from this platforms.
If you want to take CP as a sport and want to achieve as high a rating as possible in Codechef or Codeforces or any other platform… go for C++.
With C , C++ you will have an advantage of speed over Java (or Python)

But when it comes to learning Data Structures… i do prefer Java. Lear Generics and Collections(It has almost everything u will need… that too without using pointers) . (Implementing OOP with Java is lobe).

Keep Python for Web , ML , AI stuff.

I code with Java. :stuck_out_tongue_winking_eye:

2 Likes

that too without using pointers

What’s so bad about pointers, why does everyone hate them? :frowning:

Also I think C++ won’t make someone gain rating faster or anything, it’s the same with any language in beginning. It’s slightly later when things start to make some difference, that too not much.

1 Like

I my opinion , use c++ as you can get java’d with Nlog(N) solution also :slight_smile:

bro go with c++ when you are interested in competitive programming . I m doing code in java from last 3 months. I m enjoying to code in java over c++. but i face a problem that when i solve a question in codechef long or short challenge … my code gets tle while with same code and same approach code in c++ its passes easily… So i learning syntax of c++ to convert my code from java to c++ only for competitive programming. May these help you :slight_smile:

C++ is very popular but you need to know that you should program to follow your passion,you must start with the language you are very comfortable with will help you to learn programming faster,and if you want to know about some competitions in java you should check out college board ap exam cs a page.
hope this is helpful :smile:

Hey @sucks_at_cp … it’s not like i hate pointers :rofl: :joy:. How can I hate something i have not used much or accustomed to. To hate something(or someone :stuck_out_tongue_winking_eye:) u must know them inside-out right?
I just told him a feature of Java. :upside_down_face: