A common problem for rosetta-stone and polyglot challenges (and some code-challenges) is to decide when two different languages/dialects are different enough to be counted separately. Common borderline cases are C/C++, ECMAScript 5/6, Python 2/3. Very often it's possible to get one of those for free. People try to rule those out by saying things like "you may not count two versions of the same language", which gets the last two cases. But stuff like C/C++ is usually harder to rule out.
I'm asking because I'm considering to change this proposal to score by the number of different languages used.
Can we come up with some standard rules for when two languages are considered different enough for the purposes of these challenges?
5 Answers 5
Can we come up with some standard rules for when two languages are considered different enough for the purposes of these challenges?
I seriously doubt it.
Whether, e.g., C and C++ should count as different languages depends on the other winning criteria.
For polyglot, C and C++ are probably not different enough to count as two languages. Writing code that simply works in both is trivial, so that would be an extra point without any effort.
In a rosetta-stone challenge, submitting a program that will work in C and C++ is probably going to lose in both categories. Counting them as two languages makes sense, since you'll have to write two different programs.
-
1\$\begingroup\$ However, with polyglots, its worth noting that due to the implicit int, solutions that support both C and C++ may be longer. \$\endgroup\$matsjoyce– matsjoyce2014年11月04日 20:06:51 +00:00Commented Nov 4, 2014 at 20:06
-
\$\begingroup\$ @matsjoyce: For polyglots, we usually count the number of languages, not the number of bytes. At least that's the assumption I've made for the first bullet point. \$\endgroup\$Dennis– Dennis2014年11月07日 04:32:48 +00:00Commented Nov 7, 2014 at 4:32
-
\$\begingroup\$ I'm sure somebody can think up a challenge that uses both number of languages and length...
score = length - num_lang * 2
\$\endgroup\$matsjoyce– matsjoyce2014年11月07日 10:48:06 +00:00Commented Nov 7, 2014 at 10:48 -
3\$\begingroup\$ @matsjoyce: That just reinforces my point. Without knowing the winning criteria in detail, deciding whether C and C++ count as one or two languages is not a good idea. \$\endgroup\$Dennis– Dennis2014年11月07日 13:14:51 +00:00Commented Nov 7, 2014 at 13:14
Count language. Ignore Version.
Rule
Two languages are the same if they have the same name, excluding the version.
Examples
Java 7 and Java 8 count as one point.
C and C++ count as two points.
-
7\$\begingroup\$ Is
++
a version? \$\endgroup\$Ypnypn– Ypnypn2014年10月29日 00:19:41 +00:00Commented Oct 29, 2014 at 0:19 -
4\$\begingroup\$ Is
C
really just the next version ofB
? \$\endgroup\$Blue– Blue2016年06月27日 08:10:18 +00:00Commented Jun 27, 2016 at 8:10 -
\$\begingroup\$ Is JavaScript, JScript, ActionScript, ECMAScript, 4 languages? (And maybe TypeScript, CoffeeScript, etc... \$\endgroup\$tsh– tsh2018年04月08日 06:59:21 +00:00Commented Apr 8, 2018 at 6:59
-
\$\begingroup\$ @tsh If you have a new question, use the "Ask Question" button. \$\endgroup\$Rainbolt– Rainbolt2018年04月08日 07:24:03 +00:00Commented Apr 8, 2018 at 7:24
Make a list.
Rule
Two languages are the same if they belong to the same class, as designated by the community.
The community could develop a list stating that, for example, C and C++ belong to the same class. This is the most flexible method as it allows the community to reach a "best judgement", but it probably requires a lot of overhead.
Example List
- Class 1: C, C++
- Class 2: All versions of a particular language not present in another class
- Class 3: Python 2
- Class 4: Python 3
Please note that I wouldn't actually count Python 2 and 3 separately. Just trying to demonstrate the flexibility of this method.
Example Cases
Java 7 and Java 8 count as one point.
C and C++ count as one point.
Python 2 and Python 3 count as two points.
The author is the judge.
This one is self explanatory.
-
1\$\begingroup\$ While I trust some authors to be up to the task, I personally don't want to have to make the decision, especially in cases where I'm not familiar with the differences between languages/versions/dialects. I would like the result of this question to be a default choice - as with most of our standard rules, the author can always override them if he wishes to. \$\endgroup\$Martin Ender– Martin Ender2014年10月28日 18:42:36 +00:00Commented Oct 28, 2014 at 18:42
Count language. Count Version.
Rule
Two languages are the same if they have the same name and version.
Examples
Java 7 and Java 8 count as two points.
C and C++ count as two points.
-
4\$\begingroup\$ I don't like this way of doing it. You could, say, count 8 versions of Java. Oh and what about subversions? Python has features in say 2.7 that aren't in say 2.4, so they could be called different versions. And then there's C++98, C++11, ... \$\endgroup\$Justin– Justin2014年10月28日 18:25:34 +00:00Commented Oct 28, 2014 at 18:25
Perl5 and Perl6 are considered the same/different languages unless specified in the question
when dealing with Rosetta Stone type challenges so you wouldn't have to ask every time. \$\endgroup\$