11
\$\begingroup\$

A common problem for and challenges (and some s) 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?

\$\endgroup\$
  • 2
    \$\begingroup\$ I never imagined C and C++ being considered the same language. \$\endgroup\$ – feersum Oct 28 '14 at 0:02
  • \$\begingroup\$ This is still very ambiguous but I'd say languages are different if they are referred to by different names. So C and C++ are different, but when someone says Python there's no telling if the mean 2 or 3, so they are the same. \$\endgroup\$ – Calvin's Hobbies Oct 28 '14 at 0:46
  • 2
    \$\begingroup\$ @feersum It just leads to some awkward situations in rosetta stone challenges, where you submit a C program and add both C and C++ to your count. \$\endgroup\$ – Martin Ender Oct 28 '14 at 6:51
  • 3
    \$\begingroup\$ Perl5 and Perl6 are from the same family but they are considered different languages. When people say Perl, they are referring to Perl5 most of the time. It would be nice to have a standard saying 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\$ – hmatt1 Oct 28 '14 at 22:14
  • \$\begingroup\$ Related. \$\endgroup\$ – user62131 Apr 24 '17 at 23:54
11
\$\begingroup\$

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 , 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 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.

\$\endgroup\$
  • 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 Nov 4 '14 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 Nov 7 '14 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 Nov 7 '14 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 Nov 7 '14 at 13:14
5
\$\begingroup\$

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.

\$\endgroup\$
  • 6
    \$\begingroup\$ Is ++ a version? \$\endgroup\$ – Ypnypn Oct 29 '14 at 0:19
  • 3
    \$\begingroup\$ Is C really just the next version of B? \$\endgroup\$ – Blue Jun 27 '16 at 8:10
  • \$\begingroup\$ Is JavaScript, JScript, ActionScript, ECMAScript, 4 languages? (And maybe TypeScript, CoffeeScript, etc... \$\endgroup\$ – tsh Apr 8 '18 at 6:59
  • \$\begingroup\$ @tsh If you have a new question, use the "Ask Question" button. \$\endgroup\$ – Rainbolt Apr 8 '18 at 7:24
3
\$\begingroup\$

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.

\$\endgroup\$
-1
\$\begingroup\$

The author is the judge.

This one is self explanatory.

\$\endgroup\$
  • 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 Oct 28 '14 at 18:42
-11
\$\begingroup\$

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.

\$\endgroup\$
  • 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 Oct 28 '14 at 18:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .