Thread: Best language to use in a programming contest

  1. #1
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204

    Best language to use in a programming contest

    If Java, C++ and C are the only language allowed in a programming contest which one should i or you choose? Please no "Which one your comfortable with" answer please. Lets pretend im good at these 3 which one should i choose?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well if you're equally good at each language, then the problem to be solved has to be considered.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    If those are your choices a lot depends on what the contest involves. If its something that can be done in all three then to do it in C will probably require most work and to do it in Java may well be quickest but if you can expand to another language then I'd do it in Brain.........
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by Salem
    Well if you're equally good at each language, then the problem to be solved has to be considered.
    Yeah but sometimes the length of your code does matter.

    I know someone who just joined a programming contest. These guys who beat this really good C/C++ programming are not really that expert in making programs i have a feeling they won just becoz they use java. its faster and easier to compare strings. easeir to sort. etc.. etc.. Longer jobs can be solved faster.

    And lets say the compiler for C or C++ are the turbo ones. Yeah the old ones hard to navigate with against notepad and command line.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well if that's your only argument, why are you bothering with anything other than Java?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    I have read in several sites and i was convinced that C++ is the best language for programming contest. Flexibility, Speed, Easier data manipulation... etc.. etc..

  7. #7
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    It certainly seems the popular one amongst contestants here at cprogramming
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  8. #8
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    also the architecture you're working on... in the ACM competition I was in, we had a choice of (almost) any language we wanted... java would have put us at a disadvantage because 1) we didn't know much of it and 2) system resources were scarce.

    basically, pick the language you know best. if, like you said, you know all of them equally, it depends on the problem. in our case, we had about 9 different problems to solve, and tried all of them in C++, because that's what we knew best. (it was teams of 3)

    if you're in a similar situation, where you're in a team working on a timer, you'd be better off working on a team strategy. for example, we had one person looking around and doing preliminary work on other problems, somebody else thinking up algorithms for the current problem, and the last person coding it all up. they weren't strict roles, but they were roles. essentially, we left it up to the person writing the code which language to write it in...

    and one last bit of advice: if you can bring reference material, a math text can be much more helpful than a programming text.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  9. #9
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    I have a sneaking suspicion you might be talking about topcoder.

    Even if you arnt, I would got for Java most times.
    -A ton of libraries are ready and documented.
    -All the libraries are readily available in the api listing at java.sun.com
    -Using the libraries you can focus more on the solution then reinventing the wheel for functionality to simplify the problem

    C++ might have a lot of libraries as well but seriously is there as good a resource for as many libraries as java? None that i've seen.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  10. #10
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by major_small
    also the architecture you're working on... in the ACM competition I was in, we had a choice of (almost) any language we wanted... java would have put us at a disadvantage because 1) we didn't know much of it and 2) system resources were scarce.

    basically, pick the language you know best. if, like you said, you know all of them equally, it depends on the problem. in our case, we had about 9 different problems to solve, and tried all of them in C++, because that's what we knew best. (it was teams of 3)

    if you're in a similar situation, where you're in a team working on a timer, you'd be better off working on a team strategy. for example, we had one person looking around and doing preliminary work on other problems, somebody else thinking up algorithms for the current problem, and the last person coding it all up. they weren't strict roles, but they were roles. essentially, we left it up to the person writing the code which language to write it in...

    and one last bit of advice: if you can bring reference material, a math text can be much more helpful than a programming text.

    Nice to know there is someone who competed in ACM here, thats my ultimate dream to be able to compete against the best.

    The truth is its not someone i know that lost to java programmers it was me and my teammates. Im really disappointed. We were inexperienced in contests like this thats why we lost. It was our first time. I realized that we could have won it if we didnt waste a lot of time. Like you said everyone should have a role. we didnt. that cos as a lot of time. I realized that in a programming contest there should be one coder and 2 problem solver and the coder should code and type fast and really proficient in whatever language he is using. Doesnt matter if your problem solvers doesnt understand much the language what matters is that they have BRAINS and theyre good in understanding problems.

  11. #11
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    you seem to have it down... the first one is always tough, but as you can see, you came away with experience and now know how to better handle competitions of these kinds...

    I would join if I were you... even if you don't think you have enough experience, you'll probably do better than some of the other teams. my school was a business school, and we even beat out a handful of teams: final standings (we were known as "Westchester 1") take a look at some of the problems from that year too.

    also, this may interest you:
    Of the 316 runs submitted in total:
    2 were submitted in "Ada"
    44 were written in "C"
    125 were written in "Java"
    153 were written in "C++"

    Of the 129 correct submissions:
    0 were submitted in "Ada" (0%)
    13 were submitted in "C" (30% of "C" submissions)
    50 were submitted in "Java" (40% of "Java" submissions)
    66 were submitted in "C++" (43% of "C++" submissions)
    as you can see, alot of teams submitted incorrect submissions... I guess testing solutions as thoroughly as we did was also a downfall... we tried to make sure each submission was flawless, but now on reflection, we probably didn't need to (we overestimated the judges' test data)
    Last edited by major_small; 08-09-2005 at 01:33 PM. Reason: closing ')'
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  12. #12
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Thnks for the infos bro. C++ is indeed the best for contests.

    The problems are interesting ill try solve them so ill do good next time.

  13. #13
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Id vote java. Its faster to develop with, the libraries are well documented and easy to use, and the free tools available for Java are unparalleled by any free C/C++ tools (read: eclipse).

  14. #14
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    I would go with C++, not just because i know it better, but because its faster, or so i've heard from every one and every article i've read.

    And i find it to have quite some resources.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  15. #15
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >>but because its faster,

    If speed is part of the judging criteria then i'd agree. But otherwise, who cares if it takes half a second longer to run the java app. usually your timed on how long it takes you to submit your solution.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why C Matters
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 136
    Last Post: 01-16-2008, 09:09 AM
  2. Expression Evaluator Contest
    By Stack Overflow in forum Contests Board
    Replies: 20
    Last Post: 03-29-2005, 10:34 AM
  3. Language performance contest
    By nickname_changed in forum Contests Board
    Replies: 0
    Last Post: 03-02-2005, 08:51 PM
  4. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  5. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 01:20 AM