# CodeGolf Statistics - First 10 FrontPage sides [closed]

I was bored so I wrote a program in Mathematica to download all posts from the first 10 front pages (155 posts) and parse all entries to gather data from the languages and to make a top-list for code golfing.

The place is determined by the quotient of total bytes by posts, so it can be interpreted as bytes/post.

Here is the list.

Or, if you want to search for your language, have an alphabetical ordered one.

However, more interesting in my opinion is the comparison of the top 15 most popular languages by posts:

Also interesting are some graphs of the data:

The next graph is interesting. We see, that there is a clear gap between the data. I don't really know how this happens. (It reminds me very much of Sloane's Gap)

The code I used is far from perfect but does its job.

LoadCodeGolfPostLinks[index_]:=Module[{linkList,refinedLinkList},
]
sideMax=Max[{0}~Join~(ToExpression/@StringCases[sideSource,"title=\"go to page "~~a_?(IntegerQ[ToExpression[#]]&)~~"\""->a])];
If[sideMax>1,
];
sideSource
]
ParseEntrie[entrie_]:=Module[{languageNames,byteCount,centrie},
languageNames=(StringCases[entrie,Repeated[Except[" "|"\t"|","]]]);If[Length[languageNames]<1,
Null,centrie=StringDrop[entrie,StringLength[languageNames[[1]]]];
byteCount=ToExpression@(SelectFirst[StringCases[StringDelete[centrie,{"(",")"}]<>" bytes",count:Repeated[DigitCharacter]~~Whitespace...~~("bytes"|"characters"|"chars")->count,IgnoreCase->True],If[SyntaxQ[#],IntegerQ[ToExpression[#]],False]&]/.Missing["NotFound"]->(-1));If[IntegerQ[byteCount]&&byteCount>=0&&byteCount<10000,{StringTrim[StringTrim[languageNames[[1]],{":"}]],byteCount},
Null
]
]
]
MergeLC[lci_]:=Flatten/@(lci//.{"Wolfram"->"Mathematica","Brainf***"->"brainfuck","Brainf*ck"->"brainfuck","C++11"->"C++","C++14"->"C++","Python3.4.0b2"->"Python","AHK"->"AutoHokey","Windows"->"Batch","Bat"->"Batch","Visual"->"VBA",{a___,{"C/C++",b_},c___}:>{a,{"C",b},{"C++",b},c},{a___,{"C++/C",b_},c___}:>{a,{"C",b},{"C++",b},c}})
CountLC[lci_]:=Module[{languages,lMatches},
languages=DeleteDuplicates[lci[[All,1]]];
Function[{l},
lMatches=Select[lci,StringMatchQ[#[[1]],l,IgnoreCase->True]&];
{l,Total[lMatches[[All,2]]],Length[lMatches]}
]/@languages
]


Monitor[
frontPages=10;
,step]


Parsing code:

Monitor[
step="parse entries";
lce=DeleteCases[ParseEntrie/@ee,Null];
step="merge language counts";
lc=MergeLC[lce];
step="count languages";
result=CountLC[lc];
step="calculate quotients";
quotientResult={#[[1]],#[[2]],#[[3]],N[#[[2]]/#[[3]]]}&/@result;
step="sort results";
resultData=SortBy[quotientResult,#[[4]]&];
,step]
resultData=DeleteDuplicatesBy[resultData,ToLowerCase[#[[1]]]&];


If you have any questions, you are free to ask them. Perhaps I can answer it.

• For the graph with the gap, how do you determine "place of language"? Oct 6 '16 at 15:44
• The place is determined by average bytes per post. I edited it in. Oct 6 '16 at 15:46
• If you want to compare languages by size, please restrict it to answers in the [code-golf] tag. Other challenge types (koth, code-challenge) are more often answered in languages such as python, java, and c, which would inflate their scores over golf/eso-langs. They don't need to be inflated even more than they naturally are ;) Oct 6 '16 at 16:02
• I'm pretty sure your Sloane gap comes from the fact that the bottom curve is languages there were used exactly once and the next curve is languages that were used twice. (And the next, thinner line for languages used three times and then the really popular languages are all the noise at the top because they're used so often that it inflated their total byte count). Oct 6 '16 at 21:43
• Oct 11 '16 at 3:29
• Related challenge. Oct 11 '16 at 11:30
• Another related challenge and very nice graphs in this answer Oct 14 '16 at 10:43
• This information isn't entirely useful if you're using the entire post to count bytes. There are plenty of answers which contain both a golfed and an ungolfed version, plus an explanation paragraph. Oct 14 '16 at 18:58
• I'm voting to close this question as off-topic because it isn't actually a question.
– user45941
Oct 17 '16 at 22:32
• am I reading this right? the posts aren't even parsed to exclude the non-code blocks?
– user60119
Oct 18 '16 at 23:41