Time allowance for different languages

I noticed that some single player games allow more time for Python than e.g. C or Go.
Is this an official feature?

Actually, I think it would be nice to have time allowance depending on type of your language, especially for AI battles.
Brute force or extensive check being an important part of many strategies, the competition between bots in e.g. Python and C++ is not quite fair. Interpreted languages could enjoy higher time limits. What do you think?

5 Likes

I think that CodinGame is nice because it reflect real life.

If you are a professional developper and you have to build a software where performances are the biggest feature, youā€™ll never try to use anything else than C++.

6 Likes

Well, Halflings also have it hard in Blood Bowl! All the better when you manage to win a game against an C++ ork player.

3 Likes

Controlling a pod in a midiclorian field with varying degrees of physics satisfyingnessā€¦ Writing a spell in forest runesā€¦ Saving the world by grouping colors and skullsā€¦ Fighting zombiesā€¦

Yup, this totally reflects real life. Letā€™s all use C++ :smiley:

6 Likes

The description of the problem may be abstract but the underlying solution and methods are very real.

2 Likes

What do you mean by ā€œrealā€? I donā€™t think many of CodingGamers could use tricks developed here in their real-life jobs and vice-versa.

Iā€™ll hazard that CG is cool because itā€™s somewhat different from everyday tasks. Problems are funny and algorithms are varying. Itā€™s more likely that you saw some on them during your studies than in your job(s). For most part, youā€™ve probably learned it yourself with google (I have ;)).
More specifically, have you been using genetic algos for real? Monte Carlo tree search? Serious machine learning in your CV? Neural nets? Fake physics simulators? Even mini-max or A* are not very likely.

CG is more like a game, kinda sport. And sport means fair play, equal footing. In this perspective, there is nothing wrong with different time allowances for different languages.

And yet, various languages exist for a reason. IRL, we do need different tools. In CG framework itā€™s difficult to reflect all those real situations ā€“ but itā€™s pretty easy to put different tools on more equal footing.

5 Likes

I donā€™t agree with that. Codingame made me more ā€œskilledā€ at coding. Itā€™s hard to define but iā€™m just faster and more efficient at coding something.

But you are right on one thing : Iā€™ll never use the C++ tricks i use on codingame in real life. Because in real life we have -O3 in the compilation command line :stuck_out_tongue:

1 Like

Considering following things:

  • Real world optimizations are forbidden (hello ā€˜The Accountantā€™)
  • Contests are dominated by C++ (you can compute more per 100 ms, also hi to ā€˜Smash the Codeā€™)

I think the ā€˜real lifeā€™ argument is irrelevant and canā€™t be applied anymore.

Different languages need different time limits, so solutions on different languages can be truly competitive. And this is open opportunity to solve a contest on different language.

Examples: Java time = 2 * C++ time; Python time = 4 * C++ time.

4 Likes

So the meta becomes figuring out what language has the best arbitrary efficiency ratio instead? I am not sure thatā€™s really making things better.

3 Likes

I think everyone have choice between high-level language (Java/Python/C#), low-level-performance Ā© and ugly hybrid (C++), but requirements MUST be the same. If you think that one language has more pros than others - use this language.

2 Likes

Well, speaking LOUDLY doesnā€™t make an argument.
Basically youā€™re saying ā€œOne can choose their weapon, so no problemā€.
But thatā€™s beside the point.

The point is, there is a poor selection of weapons in the first place and there is a simple way to make it much more interesting.

Recently, with the rise of genetic algorithms, a typical contest becomes more and more an exercice of ugly C++ speed optimisation. I think this is not necessarily where we want to get.

A variable time allowance, could attract more people and more ideas on the board.

Actually, I do think it would be better.
The hard part is making it feasible at all.

With a large enough scale, itā€™d autobalance according to the average of the playersā€™ results. But itā€™s still Damn Hard to get right.

Can you explain how gaming the efficiency metrics across languages would make things better? I canā€™t see. Hereā€™s what I think is going to happen:

Letā€™s assume Python is, in general, 7 times slower than C++ at doing the computation youā€™re thinking of (if only real life was that easy, but letā€™s assume for the sake of discussion). But, arbitrarily, Python has been allowed 1000ms in CG, with C++ still at 100ms. So now instead of C++ being the de facto top language, itā€™s Python. And then you have to figure this out across the 20 or so languages hosted at CG.

In my opinion, thatā€™s such a pointless diversion. At least right now, it maps fairly well to what happens in real life: if you need realtime performance, you will go with C++ or an equivalent. And learning how to optimize it, which is far from trivial if you look at all the underperforming C++ solutions in the leaderboard, will teach you valuable skills you can apply in the right kind of job.

Itā€™s not hard to get those metrics right, I think itā€™s bordering the impossible. And personally, I wouldnā€™t want to be beaten by sloppy Python code after going hardcore optimization on my C++, just because it was arbitrarily given more processing time.

At least right now, I believe the rules are for the most part well known and fair. Could use more public information on the pragma stuff though.

5 Likes

Actually, it has been implemented in real life on some other site of this type. For example, python has been given 5 times C++ā€™ allowance (there are many other languages for that matter). In this setting Iā€™ve tried pretty many challenges both in python and in a fast compiled language (Go).

I think it works as expected. Still a bit easier to get the result in a compiled language. But, not surprisingly, at that point you can consider the advantage of rapid development in scripting languages. A very real life effect if you like. You choose your weapon, and this time the choice is real.

2 Likes

I think if thereā€™d be less smash the code and more codebusters, then performance would be less relevant.

6 Likes

Just because they do it does not mean itā€™s fair. My opinion is I donā€™t want to see this on CG. It will simply shift the attention to the language who happens to have the better arbitrary metrics instead. Maybe better for some people who canā€™t/donā€™t want to use low level languages, but worse for those who can.

You can argue itā€™s possible to eventually achieve the right metrics. It might be possible, but I donā€™t believe it is.

I would argue you already have this rapid development advantage. Optimizing in C++ is already much more time consuming in contests. Why artificially make it worse? Imagine the code in Python being #1 with a large gap over C++ because of this arbitrary handicap? I donā€™t see the fairness.

If you want to go with as far as real life effects are concerned, programming includes choosing the right tool for the right job. And if you need realtime performance, you can bet C++ will not be far away, and you will get looks if you go with an interpreted language.

(No offense meant to Python users by the way, it is a great language, it is just also well known to be quite slow in general and makes an easy example).

Letā€™s put it straight. You believe its hardly possible to achieve perfect balance.
Iā€™ve seen a real thing and it worked for me.

And with this experience, Iā€™d say the point is not to achieve the perfect balance (which is undefined BTW).
It would be enough to make the gap just less blatant.
And one can tweak it to their liking (as many other things here on CG).

Thatā€™s simply not true. The current bias against interpreted languages is too strong. Just look at the leaderboards.

Speaking of performacesā€¦ Well, the problem is that on CG one gets nearly full advantage of C++ (i.e. its speed and a modern compiler) and not so much of e.g. Python. I wish CG installed standard modern Python modules, say cython or numba or SciPy/scikit-learn or maybe PyPy.

I bet the C++ lovers would then start to argue they want more time. :stuck_out_tongue:

Putting it further straight, those are both opinions, which are valid to discuss. Whether it works well or not for everyone on those other sites (mentioning them would be nice) or here on CG, is also a matter of opinion. I donā€™t see how it being implemented somewhere else somehow automatically invalidates the points I have mentioned. For all I know, it could be as bad as I have explained.

And in the end, we might just have to agree to disagree on whether artificial handicaps are a good thing or not.

I did not say it was an advantage on scoring well in current conditions, but on speed of development, of course. If the contest lasted 12 or 24 hours, then that advantage might probably translate better on the leaderboards. I have often seen solutions with interpreted languages topping the leaderboards in the beginning/middle of contests.

And I donā€™t think itā€™s an arbitrary bias, itā€™s the reality. If realtime levels of performance is an important factor to consider in a problem, then it definitely will impact the choice of language. If you donā€™t want that, I would rather argue like LBandy just did: design challenges promoting strategy over computation power, instead of going for artificial handicaps.

I am all with you on that. Anything that brings a language up to par to its full potential is a plus for everyone.

This is not a language war. I would love to code my solutions in C# in contests, this is by far my preferred language, but this will not happen if I judge performance will be too much an issue, so I just go with the best tool for the job. It just so happens most challenges are designed in a way that makes C++ be better suited for topping the leaderboards. If you want to argue to change that, I wonā€™t stop you.

Wouldnā€™t want to intrude in your debate, but let me try to lay out the kind of system Iā€™d like.

By comparing with the free market. What price is fair for a loaf of bread? (or a bowl of rice, or adjust to whatever your realmā€™s base food is)

All of those have influence on the matter: the value of money, the employeeā€™s wages in the chain, the cost of production energy, buying the raw ingredientsā€¦ Yet the price tends to stabilize (geographically). Because through supply and demand, all tend to balance, since any fluctuation is ā€œdiscouragedā€ by the competition.

One way of reaching this that the C++ crowd is going to hate, is to give programs a time allowance in inverse relation with number of users in that language. You think you donā€™t have enough time? Itā€™s your responsibility to find a language where the ratio between your estimated competence and the number of users. You think Python is allowed too much? You can get it reduced by using it.

What makes it hard to get right? I can think of this:

  • how stable should the time allowance be? realtime? hourly? daily? monthly? per-contest?
  • whatā€™s a good inverse relation? proportional? capped? the CG-famous (N/P)^X?
  • how do you deal with the hordes of angry C++ coders?
1 Like

While I think itā€™s actually a really interesting idea for a single challenge, I think it would be a big mistake to apply this to the whole site. This is some meta-gamification that is massively distracting from the challenges themselves. This is fixing a ā€˜biasā€™ problem by introducing an even bigger one.

Also, since I read some comments suggesting so on the chat, I apologize if I somehow made this debate tense or unfriendly, my wording can probably use some work. Rest assured my intent is to be all friendly in debating this. :slight_smile:

2 Likes