2
\$\begingroup\$

for code golf challenges, how would bytes be counted for visual programming/patcher languages like puredata?

I thought maybe a system based on the language's saved file size for a patch, but that seems somewhat unfair as those files often contain metadata that isn't part of the program.

| |
\$\endgroup\$
7
\$\begingroup\$

"Fairness" isn't really the best measure here, because comparing different languages is generally a futile endeavour anyway unless it's been established that the language's generally have comparable scores in the first place (e.g. C# vs Java or Python vs JavaScript). If you're using a language that is structurally and semantically vastly different from other languages, you shouldn't expect to end up with a comparable score, but instead just try to get the score as low as possible within the given language (and if you're lucky you get some other people using the language to compete against).

So with that out of the way, scoring by file size really is the only viable method to determine a byte count. Metadata gets annoying in these cases, but often it's possible to remove or golf some of that metadata by hand while still keeping the file readable for the language's implementation. If that's possible, you're not required to submit the file as exported by the language, but you can shorten those parts as much as possible. The only important requirement is that the scored file can be correctly processed by the implementation.

Now of course counting bytes this way is often a bit annoying for visual languages, especially because it can be non-obvious what modifications to the visual program will actually reduce the file size. Often, you'd want to score these by components or similarly. However, it doesn't make sense to do so in a regular competition. "Code golf" means scoring by bytes and nothing else. However, if you can come up with a good and interesting scoring that is closer to the building blocks of your language, you can always write a language-specific challenge, where a problem needs to be solved with this language and the score is tailored specifically to the language at hand. Note that language-specific challenges in general are frowned upon, but if you have a good reason for limiting the challenge to a single language then go for it (and using a language-specific scoring for a language where counting bytes doesn't make sense seems like a good reason to me). I'd definitely recommend posting such a challenge idea in the sandbox first though to make sure the scoring is fair and the chosen problem is a good fit for the language.

| |
\$\endgroup\$
  • \$\begingroup\$ Or even make a visual-programming challenge, where different block-based languages can compete (do we need a new tag for that? ;) ) \$\endgroup\$ – Stephen Jun 27 '17 at 18:55
  • 4
    \$\begingroup\$ @StephenS To make that viable you'd need one single scoring that applies to all of these languages, which I think is unlikely to exist. \$\endgroup\$ – Martin Ender Jun 27 '17 at 18:56
  • \$\begingroup\$ I thought that Scratch and Minecraft had special bytecounting rules...? \$\endgroup\$ – CalculatorFeline Jun 28 '17 at 21:54
  • \$\begingroup\$ @CalculatorFeline The consensus for Scratch counts a working file format, as does Minecraft. \$\endgroup\$ – Martin Ender Jun 28 '17 at 21:58

You must log in to answer this question.

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