It would be great to have an option in answers to add metadata. (This would be most useful for questions tagged code-golf, but maybe also other tags?) You would be able to put in the language, the golfed code, current byte count, and old byte counts. Then the data could be used to sort answers by "best score", or even to make graphs of language usage and score. Those graphs could tell us surprising things (and not-so-surprising things, like that Java would be in a certain corner and J in the other.)
Here is some HTML for it (put this after the <h2 class="space">Your Answer</h2>
):
<div id="metadata">
<label>Language: <input id="metadata-byte-count" list = "langs"></label>
<datalist id="langs">
<option value="JavaScript">
<option value="JavaScript (ES6)">
<option value="Java">
<option value="C">
<option value="C++">
<option value="C#">
<option value="J">
<option value="GolfScript">
<option value="Japt">
<option value="F# ">
<option value="Batch">
<option value="Python">
<option value="05AB1E">
<option value="Ruby">
<option value="V">
<option value="MATL">
<option value="PHP">
<option value="PowerShell">
<option value="Swift">
<option value="Convex">
<option value="05AB1E">
<option value="Mathematica">
<option value="Excel">
<option value="R">
<option value="Jelly">
</datalist>
<label style="
display: block;
">Golfed code:
<textarea style="
padding: 2px;
display: block;
width: 300px;
"></textarea></label>
<label>Current byte count: <input type="number" id="metadata-byte-count" style="
font-size: 13px;
padding: 2px;
">
bytes</label>
<a href="https://codegolf.meta.stackexchange.com/questions/10145/how-to-count-bytes-faq" style="
display: block;
">Need help counting bytes?</a>
<h3 style="
font-size: larger;
display: inline-block;
padding-right: 20px;
" class="space">Old byte counts</h3>
<input type="button" id="metadata-add-old-byte-count" value="Add old byte count">
<div id="metadata-old-byte-counts">
<label><input value = "x" type = "button" style="
padding: 0.14em 0.5em;
font-size: smaller;
margin-right: 2px;
"><input type="number" class="old-byte-count" style="
padding: 0;
"> bytes</label>
</div>
</div>
Wanna try it out?
body,html{/*Fix a SE style issue that causes lots of vertical scroll*/min-width: 100% !important;}h2{font-weight: 400; }
<link href=https://cdn.sstatic.net/Sites/codegolf/all.css rel=stylesheet><h2 class=space>Your answer here</h2><div id="metadata"> <label>Language: <input id="metadata-byte-count" list="langs"></label> <datalist id="langs"> <option value="JavaScript"> <option value="JavaScript (ES6)"> <option value="Java"> <option value="C"> <option value="C++"> <option value="C#"> <option value="J"> <option value="GolfScript"> <option value="Japt"> <option value="F# "> <option value="Batch"> <option value="Python"> <option value="05AB1E"> <option value="JS "> <option value="Ruby"> <option value="V"> <option value="MATL"> <option value="PHP"> <option value="PowerShell"> <option value="Swift"> <option value="Convex"> <option value="05AB1E"> <option value="Mathematica"> <option value="Excel"> <option value="R"> <option value="Jelly"> </datalist> <label style=" display: block; ">Golfed code: <textarea style=" padding: 2px; display: block; width: 300px; "></textarea></label> <label>Current byte count: <input type="number" id="metadata-byte-count" style=" font-size: 13px; padding: 2px; "> bytes</label> <a href="https://codegolf.meta.stackexchange.com/questions/10145/how-to-count-bytes-faq" style=" display: block; ">Need help counting bytes?</a> <h3 style=" font-size: larger; display: inline-block; padding-right: 20px; " class="space">Old byte counts</h3> <input type="button" id="metadata-add-old-byte-count" value="Add old byte count"> <div id="metadata-old-byte-counts"> <label><input value="x" type="button" style=" padding: 0.14em 0.5em; font-size: smaller; margin-right: 2px; "><input type="number" class="old-byte-count" style=" padding: 0; "> bytes</label> </div></div>
Of course, this data would be available via the API and maybe even under /tools (>=2k rep only).
Maybe a UTF-8 byte counter embedded in? Or better yet, a byte counter that recognizes the language specified and picks it from there?
Note that this contains a dropdown / input that prevents us from getting 'dirty' language data (eg. "JS", "Javascript", "Java Script", "JavaScript", etc.) but still allow for obscure languages.