There is a very simple solution to this problem : having a “frontend” contest where you have to draw stuff on the screen.
Promised, C/C++ will lose
There is a very simple solution to this problem : having a “frontend” contest where you have to draw stuff on the screen.
Promised, C/C++ will lose
Well, not necessarily!
Just adding my own 2 bits…
This statement isn’t exactly true. Here is number of C / C++ in top 10 in past contests:
PCR - 1
PR - 4
PR2 - 2
TGE - 7
BTTC - 6
CvZ - 4
CSB - 5
STC - 9
CB - 4
HS - 10
TAC - 8
Overall - 62% of top 10 from these 11 contests were C++ (35% of first 4, 78% of most recent 4)
I think that there’s several elements at work here that contribute to these trends:
C / C++ gives somewhat of an advantage over most other languages. I’m not going to debate this point, but I don’t think it’s as significant (in most contests) as most people imply that it is.
Some contests heavily favor processing speed, namely STC.
CG veterans know that some contests favor C++, and so they tend to write contest code in C++ from the get-go, just to ensure that they’re not at a disadvantage.
Superstitions and rumors about the unbelievable power of the C++ abound.
More and more of the elite competitors write solutions in C++, so more of the top finishing AIs are C++ AIs.
Snowball effect.
Cue whining and pleas for overcompensation.
CG isn’t an intelligence ranking. It’s a coding skill ranking. The very best coders are intelligent, yes, but they are also skilled at many languages. The very best coders are versatile. The very best coders choose the very best language for a task. The very best coders learn from failures and do whatever it takes to improve, including learning a new tool if that’s what’s required.
My vote: Don’t handicap based on language selection.
Could there be room to gave score multipliers for buckets of time used, so if you use a heuristic that uses near zero time, you get a larger multiplier than people that choose to let the CPU search the problem space, for 90 ms. It also aligns the coders behaviour of less CPU usage with CG billing (assuming it’s cloud hosted).
Then if your going to search the space for a good answer you want to have a good pruning heuristic to get a score gain, verse that of clever simple code.
Or do things need to just have larger branching factors to make the trade off in the favour of insight verse brute force… I get the the top 10 coders have great insight into how to use GA/MC well, it’s the other sheeple doing the same thing and making everything slow…
After having formally complained by the slow startup performance of C# code in contests (ie. first turn takes a 10x performance hit) and being directed to this conversation, I’d like to add my 2c in for the sake of conversation.
I have read the whole thread so far and it’s an interesting debate.
I also think 50ms is not enough for most languages. I recognize the problems with allowing 100ms but I feel like maybe a middle of the road 70 or 80 ms might be better.
Why ppl keep using Java, Python, JS on contests when is reliably known that impossible to get top3? Even theoretically. Take a look at the truth.There is no way to win on Java. It’s like a bike against a motorcycle. A fair competition?
Some people don’t want to learn a new language. They know how to code in Java or Python and they want to do everything with it.
I have a different state of mind. I think everyone must know how to code in three languages. One fast language for performances (C or C++). Or language for big architecture and “error proofing” (Java or C#). And one script/easy/fast to code language for when you don’t need a big architecture (Javascript, Python, Ruby, Perl …).
Codingame is a little powerless on that. Let’s say codingame add +100ms for Python. Don’t forget that python can call system
to execute a command line. So i can write this: system('g++ "insert my code here" -o binary & ./binary')
(not sure about the syntax but you get the concept).
I’m convinced one day I can reach top 10 in scala.
Good way to put it Magus and I like how you broke the languages into 3 categories. I’m definitely no stranger to C/C++ and do know Javascript and Python enough to be dangerous
The fact is for me it’s not so much about not wanting to learn a new language but wanting to be able to put time into learning new algorithms and approaches to solving some of these optimization problems rather than fighting with the language. Unfortunately these days I only get an hour or two here and there to play around on CodinGame so it seems counter productive to use C or C++ because I’d be spending most of my time debugging my code and optimizing the implementation instead of working on the design.
I find Java and C# to be a good compromise of performance and capabilities.
Because not everyone cares about getting to be in the top 3. Don’t get me wrong, I’m not saying it wouldn’t be nice to win a contest but to me the fun is in the challenge. Personally I don’t have enough time to seriously compete in these contests anyway so I chose a language that I’m comfortable with that will give me the best “bang for the buck”. Some contests I only get a few hours spaced over the span of a whole week and I prefer to use that time to work on the higher level design of the solution rather than optimizing cycles. I’m also not that good to the point where I’m held back by the language though it is a bit of unfair and disappointing to see an inferior C submission run circles around a more “clever” one just because the C one can simulate deeper and brute force better.
On what basis are you judging a submission to be more clever or inferior to another if not by its score? I see that kind of argument thrown around a lot but it always sounds dismissive to me.
On what basis are you judging a submission to be more clever or inferior to another if not by its score? I see that kind of argument thrown around a lot but it always sounds dismissive to me.
You’re right, it is very subjective and maybe a bit dismissive. What I meant by “clever” is not necessarily that it’s better but that it’s more sophisticated but not necessarily practical based on the limitations of the language. And to be clear I’m not talking about the very top submissions but specifically the situation I had in mind was this: one submission has a basic evaluation function but does better than one with better heuristics because it can simulate twice or three times as many turns.
I use Python mostly because I know it well and want to learn it better. For example CotC helped me learn NumPy.
Ghost in the Cell (a Python bot earned 3rd place) and Codebusters are examples of games where I am not convinced that speed was near as important as strategy. Strategy can be written in any language and I can easily believe that Python could win. As for other games like Wondev Women, a good bot is about 70% having the correct evaluation function and 30% speed. The top 10 have mastered both parts. But to get in legend it is enough to have a good evaluation function and some sense at how to get the most speed from your language.
As for winning, I don’t think I could do any better in C++ because I don’t know C++. Of course if I was serious about this, then I would learn C++ well beforehand (and that is a long term goal of mine), but this is not a super serious endeavor for me. This is a fun way to learn programming. I am not in it for the 1st place finish.
I believe the languages here should reflect the real world speeds. The way i see it this site is for practice, so it’s best to get a real feel of how fast a language actually is.
the languages here should reflect the real world speeds… it’s best to get a real feel of how fast a language actually is.
In the real world i can add native library to java, which can be written on C++ or even on assembler. To replace a hot spot region of my java code
Actually, at most parts you have to pay your speed to get some extra language features.
Native BigInteger and HashMap in Java is some kind equal to C doubled performance
Personnaly I like the idea to share the same constraints whatever the language, this is a supplementary challenge.
In real world you try to tweak as much as you can to respect constraints. We are here benefiting of an easy to use platform to develop, sometime I’m not happy to not being able to choose compilation flags, or even compiler instead of VM (ocaml use case).
But platform is well designed, easy to use, and bring a lot of fun.
Competing is good but not if we forget to have fun. C & C++ have a clear advantage, in a real world for numerical computing it is easy to be more performant with other languages.
If the goal is to be more performant and be the first, constraints of the platform must be respected. If the goal is to improve through challenges and share, time allowance doesn’t matter either.
My view point is on the one hand to preserve simplicity in challenge rules, so same time for all languages, on the other hand improve incrementally the platform with more possibilities of tweaking or choosing options performant by default (this approach is hard to stabilize).
To conclude, thank you CG guys for this platform, and KISS (Keep It Simple & Stupid).
Landed here by chance… I don’t want to reopen old wounds. Just provide a sports-related analogy.
Running (I mean 10km or more) is a sport where the casual runner might participate in a competition with real top-runners (think New York Marathon for example). Nobody complains about this and asks to put weights on them, or run shorter distances. So the bottom line is: I think it’s OK to make all compete on the same field with the same constraints.
It’s even better with programming: while I cannot even dream to ever reach top-runners’ pace (because of physical constraints), here I can learn C++ and get serious about optimizations and learn, learn, learn. I don’t have the time to do that and I’m still happy with using Perl.
To continue on the analogy, a few ideas:
most races also have winners in sub-categories (usually by age in Italy). This might be worth exploring more, although it’s somehow already there for gaining experience points (“finish first in language”, “finish in the first three in a language”, …) and I’m fine with that anyway.
not all races are marathons… maybe we might have also shorter-time contests, like 1, 2 or 3 days? Probably this would move the balance towards faster-prototyping languages, reflecting a real-world situation where processing speed is less important than having something as soon as possible.
Thanks all for the fun and learning that is available here!
Very intersting topic.
I read arguments of ones and others and I globally agree with ones of reCurse, Magus :
=> We mustn’t look for a balance between langages.
I think a pretty good solution would be to give MORE TIME to slow langages BUT with respect to langage speeds.
Let’s say Python is 5x slower than C++, just give it 2x time. No need to balance, just to reduce huge differences.
It should help to find nice solutions, but will prevent Python from beating C++ in pure computing capabilities.
And it could be more interesting to learn new langages.
For example, I’ve done the “Mars Lander 3” puzzle in C++, but now… I want to practice Python.
Maybe it’s possible to solve all “hard” or “very hard” puzzles in Python ?, but logically, the code need to be MORE optimized (I just learn Python, hard to know how to optimize)
I’m totally agree with this, but I think they should at least limit the language used because it’s not feasible in higher ligue.