32
\$\begingroup\$

I feel like we may have enough data on this site to meaningfully break programming languages into classes.

What I mean by classes is akin to Go's ranking system:

If a player can win 90% of even games against a 2 kyu player, the AGA believes he or she is 1.33 ranks higher, the EGF believes (s)he is 2.42 ranks higher, and the IGS believes (s)he is more than 3 ranks higher.

We may need to break the competition down into tags (e.g., a puzzle may have a different ranking system than a puzzle (cough, Bubblegum).

The use case for this would be to more reasonably compare your success - If a Python answer beats one in J, the author should be pretty proud. If Pyth beats Java by just a bit, the Java author should also be pretty happy with themselves (or the Pyth author ashamed).

Would anyone be interested in this endeavor?

| |
\$\endgroup\$
  • 1
    \$\begingroup\$ It's an interesting idea, but I think most of us have already formed subjective opinions; for example, I consider Ruby, Python, Perl, etc. in a higher and fairly well-defined "class" than Java, Rust, etc. Nevertheless, if you do attempt something like this, I'd be very curious to see the results! (I have a language-detection script floating around somewhere, in a Github Gist I think, that could come in handy.) \$\endgroup\$ – Doorknob Mar 25 '16 at 16:58
  • 7
    \$\begingroup\$ I think there are two (broad) schools of thought on what "success" means here in golf terms. One is getting the overall shortest by choosing the appropriate language for each task (choosing your tools). The other is finding the shortest given a certain tool (language). While I like to beat up on C# with Java as much as the next guy, it's not a true comparison across all golfs, because the real difference is (mainly) which builtins are there and how they're named. So I'm not sure I see how ranking each would help people in either school of thought judge their success. \$\endgroup\$ – Geobits Mar 25 '16 at 17:03
  • \$\begingroup\$ To echo what Geobits said -- defining the tasks that make up the metric is going to be extremely difficult and subject to much debate. Many languages are very close on the Hello World challenge, simply because "Hello, World!" (with or without the trailing ") is a valid program in dozens of languages. Or ones where a particular language has a clear built-in that leapfrogs it ahead of where it would "normally" sit. Challenges like that would skew the numbers incorrectly. Not that I'm against the idea, it just needs a lot of rigor. \$\endgroup\$ – AdmBorkBork Mar 25 '16 at 17:51
  • \$\begingroup\$ @TimmyD Yes - and I have no statistical background, so I'd like to get someone with more stats knowledge on board before pursuing it. \$\endgroup\$ – Not that Charles Mar 25 '16 at 17:53
  • 7
    \$\begingroup\$ I honestly have no clue why this has been consistently downvoted so far. While the commenters have a point that it's going to be hard to figure out how to get the most meaningful data, I'm pretty sure that across all our code golfs we can find significant trends easily enough. It may be hard to determine with any certainty whether C# or Java is better for golfing, but I'm sure we can detect some fuzzy ranking. +1, I like the idea of trying to mine some data from our content. \$\endgroup\$ – Martin Ender Mar 25 '16 at 18:59
  • 3
    \$\begingroup\$ @MartinBüttner, it's probably suspicion about motives. I'm fighting the temptation to downvote by reminding myself that we should assume good faith, but the context of previous meta questions by people who were pushing handicap systems does inevitably affect the subtext I read into this one. \$\endgroup\$ – Peter Taylor Mar 25 '16 at 19:20
  • 3
    \$\begingroup\$ @PeterTaylor That's a good point, but I'd rather downvote the post making use of such a handicap system than an attempt to gather some interesting data from our challenges. \$\endgroup\$ – Martin Ender Mar 25 '16 at 19:28
  • 1
    \$\begingroup\$ @PeterTaylor I am not very active in meta and haven't read that thread. I don't have motives aside from what is presented. \$\endgroup\$ – Not that Charles Mar 25 '16 at 20:01
  • 13
    \$\begingroup\$ @PeterTaylor Also, for the record, I think a handicap system is a terrible idea. \$\endgroup\$ – Not that Charles Mar 25 '16 at 20:01
  • \$\begingroup\$ Another reason is that it would be nice to see a language competition - some sort of aggregate of all the work folks have done to abuse languages. Where does Perl beat Ruby? Does D beat C? Where does TI-BASIC beat Mathematica? \$\endgroup\$ – Not that Charles Mar 25 '16 at 20:38
  • 1
    \$\begingroup\$ I downvoted because, not only would this be very difficult and many people would disagree with the classes due to the subjectivity involved, but defining language classes opens the door to attempts to impose handicaps, which I am strongly against. \$\endgroup\$ – Mego Mar 25 '16 at 21:59
  • \$\begingroup\$ We already have some data in response to this code challenge. \$\endgroup\$ – xnor Mar 25 '16 at 23:13
  • 9
    \$\begingroup\$ I don't see why people are so opposed to this. Everyone knows that some languages are golfier are other. Most golfers already have a vague sense of the ordering, and surely actual statistics are better. \$\endgroup\$ – xnor Mar 26 '16 at 4:29
  • 5
    \$\begingroup\$ Seems like a fine idea to me. While it shouldn't be considered definitive, it'll probably be interesting. \$\endgroup\$ – isaacg Mar 26 '16 at 7:27
  • \$\begingroup\$ @xnor Like I mentioned before, I don't think it's a worthwhile endeavor. The lines are too fuzzy to be able to create clear-cut classes, and there are lots of issues that skew the data such that the classes would not be meaningful (as I commented on Alex's answer). \$\endgroup\$ – Mego Mar 29 '16 at 1:18
19
\$\begingroup\$

Elo ratings, treating pairs of submissions as games.

I'm using the Elo system here.

Essentially, the solution is find the best solutions in each language to each challenge, and then treat each pair of such solutions as a match between those two languages, with the winner being the shorter submission.

Languages with less than 10 entries are discarded, and languages have a starting rating of 1000.

One drawback of this system is that ELO favors more recent entries. To compensate, I used a relatively low K value, which makes updates slower, and so old answer count for more.

The data is from this query, courtesy of Alex A. To run the code, put the two code blocks below in files with the names given, put the query csv file in ratings.csv, and run parse.py

New results, with bug fix

In the old version of the code, there were two bugs:

  • Answers with hyperlinks in the header were not counted.

  • Languages with numbers in the name were not counted.

I have fixed both bugs. In doing so, the code now considers differently named versions of a language (e.g. Python 2.7 and Python 2) to be different languages. I don't think this is a major problem - allowing languages with numbers in the name is much more important.

Also, since many more answers are correctly parsed, more languages meet the threshold to be displayed.

2020 Results:

Stax:                                    1914
05AB1E:                                  1906
Jelly:                                   1900
Husk:                                    1877
Neim:                                    1862
Canvas:                                  1861
MATL:                                    1842
SOGL V0.12:                              1814
Pyke:                                    1804
GS2:                                     1780
Gaia:                                    1769
Japt:                                    1768
Brachylog:                               1768
MathGolf:                                1701
Actually:                                1665
Ohm v2:                                  1658
Jstx:                                    1625
Convex:                                  1620
Pyth:                                    1604
Ohm:                                     1580
V:                                       1567
SOGL:                                    1543
Pip:                                     1541
Seriously:                               1537
Jolf:                                    1527
Sesos:                                   1520
Pushy:                                   1505
Japt v2.0a0:                             1485
TeaScript:                               1478
k:                                       1452
J:                                       1443
GolfScript:                              1441
Charcoal:                                1439
CJam:                                    1439
2sable:                                  1438
RProgN 2:                                1426
k4:                                      1413
Recursiva:                               1409
Alice:                                   1402
x86:                                     1390
Burlesque:                               1388
𝔼𝕊𝕄𝕚𝕟:                                   1380
cQuents:                                 1372
APL+WIN:                                 1367
Keg:                                     1363
Pyt:                                     1347
Vitsy:                                   1342
x86 machine code:                        1341
Retina:                                  1324
Attache:                                 1315
Dyalog APL:                              1314
Implicit:                                1309
Stacked:                                 1305
Bubblegum:                               1305
APL:                                     1299
q/kdb+:                                  1287
RETURN:                                  1283
Befunge 98:                              1277
Wonder:                                  1268
Perl 6:                                  1268
Runic Enchantments:                      1264
Add++:                                   1253
Befunge:                                 1244
Backhand:                                1244
Minkolang 0.15:                          1238
Braingolf:                               1234
Vim:                                     1220
Jellyfish:                               1217
Candy:                                   1216
sed:                                     1207
Wolfram Language:                        1204
Microscript II:                          1203
Snails:                                  1200
Sclipting:                               1200
Ahead:                                   1188
Julia 1.0:                               1172
Perl 6:                                  1165
Aceto:                                   1165
GNU sed:                                 1163
O:                                       1142
Z80Golf:                                 1138
Befunge 93:                              1137
Bash + coreutils:                        1134
QBIC:                                    1132
Retina 0.8.2:                            1129
Mathematica:                             1129
Gema:                                    1128
Regex:                                   1120
Ruby 1.9:                                1117
Triangular:                              1116
Bash + GNU utilities:                    1114
Octave:                                  1103
Mumps:                                   1103
BBC BASIC:                               1102
Labyrinth:                               1097
Perl:                                    1094
MATLAB/Octave:                           1082
Ly:                                      1082
Julia:                                   1075
Noether:                                 1069
Ruby:                                    1068
Pari/GP:                                 1068
R:                                       1067
Maple:                                   1067
TI:                                      1063
Cheddar:                                 1056
golflua:                                 1048
Arcyóu:                                  1046
Julia 0.6:                               1043
Proton:                                  1035
Hexagony:                                1014
dc:                                      1012
Coconut:                                 1011
Flobnar:                                 1010
AWK:                                     1009
Fourier:                                 1007
postscript:                              1006
Rebol:                                   1005
Chip:                                    1003
Funky:                                   1001
Zsh:                                     1000
PowerShell:                              998
Windows PowerShell:                      994
Bc:                                      984
jq:                                      983
Groovy:                                  979
ShapeScript:                             978
Sage:                                    974
q:                                       971
Logo:                                    966
AppleScript:                             966
Röda:                                    963
Pure Bash:                               960
Perl 5:                                  958
Mouse:                                   958
MY:                                      949
MATLAB:                                  948
PHP 7.1:                                 947
shortC:                                  943
ink:                                     941
Google Sheets:                           940
DUP:                                     932
Nim:                                     927
WinDbg:                                  925
Python 3.8:                              925
REXX:                                    922
Tcl/Tk:                                  920
Crystal:                                 920
Python 3.6:                              916
Haskell:                                 912
Smalltalk:                               907
Cubix:                                   907
SVG:                                     901
Excel:                                   901
SpecBAS:                                 898
JavaScript:                              898
Bash:                                    892
SmileBASIC:                              888
Python 3.5:                              888
OCaml:                                   886
CoffeeScript:                            878
PowerShell v3+:                          877
Erlang:                                  869
Marbelous:                               866
TXR Lisp:                                861
ES6:                                     859
PowerShell v2+:                          853
Excel VBA:                               846
Scheme:                                  842
VBA:                                     830
Red:                                     830
AHK:                                     826
PHP:                                     824
Scala:                                   823
Python:                                  813
AutoHotKey:                              808
JavaScript ES 6:                         805
Python 2:                                804
Processing:                              803
SmileBASIC 3:                            802
Hoon:                                    795
HTML:                                    790
Java:                                    788
AutoIt:                                  788
C#:                                      787
Python 3:                                784
BotEngine:                               782
IBM/Lotus Notes Formula:                 780
Cubically:                               779
C99:                                     774
CSS:                                     773
Emacs Lisp:                              770
Forth:                                   769
Delphi:                                  769
ECMAScript 6:                            768
Icon:                                    766
Kotlin:                                  765
Dart:                                    765
Java 11:                                 759
Python 2.7:                              758
QBasic:                                  757
Yabasic:                                 751
8th:                                     750
Clojure:                                 748
C:                                       747
Cobra:                                   745
TeX:                                     743
Axiom:                                   737
Elixir:                                  734
SWI:                                     733
tcl:                                     732
Clean:                                   728
Hassium:                                 727
Decimal:                                 719
SQF:                                     717
GameMaker Language:                      714
HTML + javascript:                       705
Standard ML:                             698
tinylisp:                                696
Factor:                                  695
Rust:                                    694
OIL:                                     692
C# 6:                                    690
Java 8:                                  687
Prolog:                                  685
SAS:                                     677
MarioLANG:                               675
Batch:                                   675
D:                                       674
F#:                                      664
Swift 4:                                 659
JS:                                      659
Lithp:                                   657
Piet:                                    645
TSQL:                                    643
Operation Flashpoint scripting language: 643
Go:                                      641
brainfuck:                               636
Common Lisp:                             628
Fortran:                                 627
SimpleTemplate:                          623
VB.net:                                  602
Swift 3:                                 589
Racket:                                  585
Lua:                                     584
Java 10:                                 574
C++11:                                   569
Brain:                                   569
Pepe:                                    556
Swift:                                   542
C++:                                     539
T:                                       528
LaTeX:                                   527
ListSharp:                               526
Windows Batch:                           523
C++14:                                   523
Java 7:                                  510
SNOBOL4:                                 505
Ceylon:                                  505
ForceLang:                               491
Oracle SQL 11.2:                         479
S.I.L.O.S:                               472
Pascal:                                  458
Turing Machine Code:                     453
Emojicode:                               420
LOLCODE:                                 384
Whitespace:                              381
Taxi:                                    315
Poetic:                                  295
ArnoldC:                                 240
Shakespeare Programming Language:        224

Code:

elo.py:

STARTING = 1000
SCALE = 400
K = 10
PAD = 50

import itertools
def concat(x):
    return list(itertools.chain.from_iterable(x))

class Ratings:
    def __init__(self, challenges):
        langs = concat(challenges)
        self.ratings = {lang: STARTING for lang in langs}
        for challenge in challenges:
            self.update_challenge(challenge)

    def update_game(self, first, second, score):
        f_rat = self.ratings[first]
        s_rat = self.ratings[second]

        f_exp = 1/(1 + 10 ** ((s_rat - f_rat) / 400))
        s_exp = 1/(1 + 10 ** ((f_rat - s_rat) / 400))

        f_upd = K * (score - f_exp)
        s_upd = K * ((1 - score) - s_exp)

        self.ratings[first] += f_upd
        self.ratings[second] += s_upd

    def update_challenge(self, scores):
        for lang1 in sorted(scores):
            for lang2 in sorted(scores):
                if lang1 > lang2:
                    s1 = scores[lang1]
                    s2 = scores[lang2]
                    result = 1 if s1 < s2 else 0.5 if s1 == s2 else 0
                    self.update_game(lang1, lang2, result)
    
    def __str__(self):
        return '\n'.join(key + ':' +
                ' ' * (max(len(lang) + 1 for lang in self.ratings) - len(key)) + str(val)
                         for key, val in sorted(((lang, int(self.ratings[lang]))
                             for lang in self.ratings),
                             key=lambda x:x[::-1], reverse=True))

parse.py:

import csv
import re
import elo

CUTOFF = 10

lines = []
scores = {}
challenges = []
lang_counts = {}
canon_to_actual = {}

with open('ratings.csv') as csvfile:
    reader = csv.DictReader(csvfile)
    for row in reader:
        lines.append((row['Body'], row['ParentId']))

count = 0
for line, challenge in lines:
    line = re.sub("<s(trike)?>.*</s(trike)?>", "", line)
    line = re.sub("<a[^>]*>", "", line)
    line = re.sub("</a>", "", line)
    match = re.match("<.*>(.*)</.*>", line)
    if match:
        line = match.group(1)
        lang = re.match("([^-,\(:]*)", line)
        if lang:
            lang = lang.group(1).strip()
            canon = lang.lower().replace(' ', '')
            canon_to_actual[canon] = lang
            score = re.search("(\d+)\s*\w*\)?$", line)
            if score:
                score = int(score.group(1))
                c = scores.get(challenge, [])
                c.append((canon, score))
                scores[challenge] = c
                lang_counts[canon] = lang_counts.get(canon, 0) + 1

for c in sorted(scores, key=int):
    results = scores[c]
    c_map = {}
    for canon, score in results:
        if lang_counts[canon] > CUTOFF and re.match("\w", canon):
            lang = canon_to_actual[canon]
            old_score = c_map.get(lang, score)
            c_map[lang] = min(score, old_score)
    challenges.append(c_map)

print(elo.Ratings(challenges))

Here are the original ratings, generated with the buggy code, for posterity.

2016 Results

Jelly:                1906
Pyth:                 1711
GS:                   1674
Japt:                 1653
MATL:                 1607
Dyalog APL:           1580
J:                    1579
CJam:                 1578
Jolf:                 1559
Seriously:            1535
TeaScript:            1499
GolfScript:           1497
Pip:                  1478
Burlesque:            1460
APL:                  1443
O:                    1427
Vitsy:                1424
𝔼𝕊𝕄𝕚𝕟:                1384
Vim:                  1371
q:                    1355
K:                    1322
TI:                   1301
sh:                   1294
Octave:               1289
PARI/GP:              1272
dc:                   1269
GNU sed:              1229
Retina:               1213
x:                    1209
Bash + coreutils:     1207
Bash + GNU utilities: 1201
bc:                   1189
golflua:              1187
Sed:                  1182
HTML:                 1168
Julia:                1165
QBasic:               1156
Sage:                 1146
Ruby:                 1124
AWK:                  1101
ZSH:                  1086
Mathematica:          1083
Gema:                 1079
Bash:                 1079
jq:                   1060
Haskell:              1051
MATLAB:               1042
PowerShell v:         1028
Perl:                 1028
BBC BASIC:            1022
Piet:                 1019
Score:                1018
Shell script:         1017
Mumps:                1015
Languages:            1013
ECMAScript:           1012
Regex:                1000
LiveScript:           993
Tcl:                  989
CoffeeScript:         988
Groovy:               986
Postscript:           984
Windows PowerShell:   981
Powershell:           966
R:                    964
Befunge:              964
gawk:                 951
AutoHotkey:           934
Javascript ES:        931
Smalltalk:            928
STATA:                926
Matlab/Octave:        926
REBOL:                923
SAS:                  917
Clojure:              913
ES:                   909
PHP:                  908
Dart:                 908
Python:               894
JavaScript:           894
Node.js:              893
F#:                   880
Marbelous:            875
Excel VBA:            858
AutoIt:               853
Shell:                850
Common Lisp:          845
Brainfuck:            843
Lua:                  835
Processing:           832
Scheme:               824
CSS:                  823
Pure bash:            821
SWI:                  786
Game Maker Language:  785
FORTH:                778
SpecBAS:              776
Scala:                772
Cobra:                769
HTML + JavaScript:    758
Whitespace:           750
Applescript:          739
T:                    724
Batch:                720
Fortran:              715
Prolog:               711
Turing Machine Code:  708
C:                    706
SQL:                  704
VBA:                  703
Factor:               700
Kotlin:               690
JS:                   686
Pascal:               685
Erlang:               674
Emacs Lisp:           673
OCaml:                668
Racket:               658
VBScript:             654
VB.NET:               643
Swift:                636
D:                    621
Windows Batch:        612
Ceylon:               591
C++:                  587
Java:                 559
Oracle SQL:           548
Delphi:               539
Go:                   537
C#:                   535
Rust:                 528
| |
\$\endgroup\$
  • 2
    \$\begingroup\$ Great list, and it also represent well what's the reality. Actually, there's one more thing to do: make it case insensitive. There's for instance, one entry for Javascript ES and an other one for JavaScript ES \$\endgroup\$ – Katenkyo Apr 5 '16 at 11:23
  • \$\begingroup\$ This seems to get around the problem of some languages only being used on easy challenges, since two languages are only compared on challenges they have in common. \$\endgroup\$ – trichoplax Apr 5 '16 at 13:58
  • \$\begingroup\$ I also like that a language is scored by its shortest answer to a question, so it approximates the best a language can do rather than the average performance across a number of different users. \$\endgroup\$ – trichoplax Apr 5 '16 at 14:00
  • \$\begingroup\$ @Katenkyo Fixed the capitalization problems. \$\endgroup\$ – isaacg Apr 5 '16 at 14:56
  • \$\begingroup\$ The Elo system might actually be better that you say, assuming you parse the answers in posted-order. Languages here evolve over time. \$\endgroup\$ – Nathan Merrill Apr 5 '16 at 18:23
  • \$\begingroup\$ @NathanMerrill They're sorted by question age, so you might be right. \$\endgroup\$ – isaacg Apr 5 '16 at 19:30
  • 2
    \$\begingroup\$ I think one of the reasons jelly ranks so high is that dennis is the only one who knows how to use it. =) \$\endgroup\$ – James Apr 22 '16 at 4:14
  • \$\begingroup\$ @DJMcMayhem: I don't think so. I think Dennis uses Jelly because it's short (as do I), rather than Jelly being short because Dennis uses it. (You can observe that Dennis tends to do equally well, relative to other entries in the same language, when using a language other than Jelly; but the entry ends up overall longer.) \$\endgroup\$ – user62131 Apr 25 '17 at 16:13
  • \$\begingroup\$ @isaacg, could you implement a matching to <a>...</a> links? The majority of new answers have hyperlinks to the language repo. \$\endgroup\$ – user92069 Apr 30 at 11:00
  • \$\begingroup\$ Wish ShortC could be on the list. But almost no one uses it! (besides me and I didn't even make it). Though it's really a shortener because it just expands into C. \$\endgroup\$ – Wezl Apr 30 at 15:15
  • \$\begingroup\$ Bugs: missing 05AB1E/osable, lists matlab / octave / 'matlab/octave' separate \$\endgroup\$ – Wezl Apr 30 at 15:19
  • \$\begingroup\$ @Wezl The majority of 05AB1E answers hyperlink 05AB1E in the header, that's why it doesn't show up. \$\endgroup\$ – user92069 May 1 at 3:39
  • 3
    \$\begingroup\$ @Λ̸̸ I fixed two bugs, the hyperlink bug and a bug that meant that languages with numbers in the name weren't counted. 05AB1E was hit bu both of those, now it's shot to the top. \$\endgroup\$ – isaacg May 1 at 5:41
  • \$\begingroup\$ @Wezl Even after I fixed the first 2 bugs, shortC still isn't showing up. The language only appears 7 times in the results of my query, which is strange because it shows up way more than that when I search the site. Those 7 times are too few to give it a solid rating. I don't know what's wrong with the query, I didn't write it. \$\endgroup\$ – isaacg May 1 at 5:43
  • 1
    \$\begingroup\$ @KrzysztofSzewczyk This is talking about the old version of the program, which predated TIO. The new version of the program fixes that problem. \$\endgroup\$ – isaacg Jun 8 at 17:35
16
\$\begingroup\$

K-means clustering by code length

Note: This is just a first-pass attempt with a very simple method. There are certainly better ways to approach this but at least this is a start.

My approach here was to get all answers to code golf challenges without bonuses that had (at least somewhat) appropriately formatted post headers, parse out the language name and byte count from the header, perform k-means clustering on the sizes with 6 groups, and for each language select the cluster into which most of the sizes for that language fell. Languages which have been used fewer than 10 times on the site, as well as any answer with a byte count greater than 170, were excluded.

The clusters are listed in ascending order of the values of their cluster centers.

Group 1, mean 12.03099

APL            GS2             Rebmu
Arcyou         Hexagony        rs
AutoIt         J               Sed
Batch          Japt            Self
BC             Jelly           Seriously
Beeswax        Jolf            Stuck
Befunge        K               TeaScript
Brachylog      Labyrinth       TI-BASIC
Brainfuck      Marbelous       Vim
Burlesque      MATL            Vitsy
Candy          Microscript     zsh
Clip           Minkolang
DC             Mouse
DUP            O
Element        Piet
ESMin          Pip
Factor         Platypar
Fission        Prelude
Gema           Pyth
GolfScript     QBASIC

Group 2, mean 31.75217

><>
CJam
Dart
F#
GTB
JQ
Julia
KDB
Mathematica
Matlab
Milky Way
PARI/GP
Perl
Q
Rebol
Regex
Scheme
Shell
Snails

Group 3, mean 54.14769

Awk
Bash
Clojure
D
Foo
Forth
Game Maker Language
Hassium
Pascal
PowerShell
R
Retina
Ruby
Sclipting
Smalltalk
Stata

Group 4, mean 79.65123

BBC Basic        Scala
CoffeeScript     SQL
Common Lisp      Swift
CSS              TCL
Emacs Lisp       VB.NET
Fortran          VBScript
GolfLua
Groovy
Haskell
JavaScript
Lua
Mumps
PHP
Processing
Prolog
Python
Racket
Rust
Sage
SAS

Group 5, mean 109.9524

C
C++
Ceylon
Delphi
Erlang
Gawk
Java
Postscript
VBA

Group 6, mean 147.5168

AppleScript
C#
Cobra
Go
HTML
OCaml
SpecBAS
Whitespace

Thoughts on this grouping

This is roughly what one might expect, with the golfing languages in tier 1 and Java in tier 5. This particular grouping appears to be somewhat of a success in that regard. However, 6 was probably too many groups; 4 or 5 would likely be sufficient. Heirarchical clustering may be another interesting route for analysis since no number of classes is prespecified.

Disclaimer

This should not, under any circumstances, be used to impose any kind of language handicap or restriction. It's merely for the sake of interest and giving folks a group to mentally compare their scores to, should they feel the need.


For the curious

The data were collected via this Stack Exchange Data Explorer query. The analysis was done in R and is available via this Gist.

| |
\$\endgroup\$
  • 15
    \$\begingroup\$ I can spot one fatal flaw in this approach: challenges that would require significantly long code in golfing languages are usually not answered with those languages. For example, as the source of almost all of the Seriously answers, I admit that I usually don't try to answer a challenge with Seriously unless it's under 40 or so bytes (because any longer becomes unmanageable thanks to my poor design decisions). This skews Seriously towards a higher tier than what it probably should be. \$\endgroup\$ – Mego Mar 27 '16 at 7:00
  • 1
    \$\begingroup\$ @Mego Yep. There's a whole lot I didn't take into account. This is just a means of getting the ball rolling on an approach in the simplest possible way. \$\endgroup\$ – Alex A. Mar 27 '16 at 7:04
  • \$\begingroup\$ 404 on the gist. When you say "perform k-means clustering on the sizes with 6 groups", what exactly was the input to the clustering algorithm? \$\endgroup\$ – Peter Taylor Mar 27 '16 at 17:56
  • \$\begingroup\$ @PeterTaylor Looks like I accidentally deleted the gist. I've readded it and updated the URL. The input was the code lengths as parsed from the headers. Those were grouped into 6 classes using k-means and merged back to their respective languages. Then, for each language, I selected the class into which it fell most often. \$\endgroup\$ – Alex A. Mar 27 '16 at 18:08
  • \$\begingroup\$ As an avid vim user and a vim golfer, I'm really happy to see it in the same tier as the golfing languages. =D \$\endgroup\$ – James Mar 28 '16 at 1:34
  • 7
    \$\begingroup\$ I was quite surprised to see QBASIC in the top tier, until I looked at the QBASIC answers on the site. It's pretty good backup for Mego's comment. I suppose there's probably a somewhat better way to do this, but I'm not really sure it won't be filled with these outliers as well. \$\endgroup\$ – Geobits Mar 28 '16 at 2:23
  • \$\begingroup\$ Perhaps sampling from a set of challenges with many answers in many different languages would be better, rather than across the entire site, to avoid the problem I brought up. Granted, I still don't think this will result in anything useful. \$\endgroup\$ – Mego Mar 28 '16 at 7:04
  • 2
    \$\begingroup\$ I think that @Mego's comment deserves some thought. Perhaps we should score based on relation to the median answer of each question? \$\endgroup\$ – Not that Charles Mar 28 '16 at 14:31
  • 3
    \$\begingroup\$ What poor souls answered in Delphi? \$\endgroup\$ – Morgan Thrapp Mar 28 '16 at 18:34
  • 1
    \$\begingroup\$ I think BATCH is in the first group because not many people answer in BATCH, and, when they do, it's usually on an easy question. \$\endgroup\$ – Conor O'Brien Apr 3 '16 at 22:36
  • \$\begingroup\$ @CᴏɴᴏʀO'Bʀɪᴇɴ more reasons why this is biased -- cool, but biased \$\endgroup\$ – cat Apr 5 '16 at 1:21
  • \$\begingroup\$ @Mego this is probably how Brainfuck ended up in group 1 \$\endgroup\$ – Felix Dombek Oct 6 '17 at 2:25

You must log in to answer this question.

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