23
\$\begingroup\$

I find that much of the joy and art of code golf comes from the ridiculous tricks and optimizations needed to squeeze every character. Yet, I find myself losing motivation to do so because I feel like the site doesn't give enough incentive to try my absolute hardest.

If I work hard to cut 2 chars, few people will appreciate the difference between 78 chars and 76 chars, and the post will get upvotes either way. It's hard to appreciate the difference between a good golf and a great golf unless you look into it closely or try it yourself. Often, there's no other answer in the same language to compare to. And with so many challenges posted, everyone's effort and attention is split, making it hard to justify focusing hard on any one challenge.

I myself am lucky that I golf in a language (Python) that many people know and golf in. So, my tricks are likely to have golfers who appreciate them, some of whom compete with their own Python answers or suggest improvements. This is great, and I'd like to see much more of it. For less common languages though, it seems like there is little pushing for a well-optimized answer other than the writer's internal motivation.

How do you feel about motivation to golf? Is this worth looking into? Should we do anything more to encourage or reward more meticulous golfing, and if so, what?

(I talk about golfs, but this all applies equally to code challenges, fastest code, etc.)

\$\endgroup\$
5
  • 8
    \$\begingroup\$ A thing I do sometimes is show off some of the more interesting 1-2 byte optimizations that I made in the post. For example, this recent solution of mine. \$\endgroup\$
    – Doorknob Mod
    Commented May 7, 2015 at 21:41
  • \$\begingroup\$ The title of the question is "Can we and should we" but the message is "How can we". The current title is pretty much rhetorical. \$\endgroup\$
    – Rainbolt
    Commented May 7, 2015 at 21:41
  • \$\begingroup\$ @Rainbolt I'm giving my opinion of course, but I am asking the question. Are you suggesting I do this differently? \$\endgroup\$
    – xnor
    Commented May 7, 2015 at 21:45
  • 1
    \$\begingroup\$ The sad truth is that StackExchange isn't the really the best platform for serious code-golfing. If you really want serious golf, you're stuck with whatever Shortening Codes(SPOJ)/JAGC/Anarchy Golf(shinh)/etc has to offer. \$\endgroup\$
    – nderscore
    Commented May 11, 2015 at 1:27
  • \$\begingroup\$ This reminds me of this answer I posted \$\endgroup\$ Commented May 30, 2015 at 18:50

3 Answers 3

14
\$\begingroup\$

I think that meticulous golfing, as you put it, is discouraged here by two factors:

  1. Our framework makes all solutions public, and that has produced some weird conventions and assumptions. Sometimes there is only one way in a given language to get close to the optimal score. Maybe I have a 90 byte perl solution and you have a 60. I can squeeze my 90 all day long and it not get smaller, because to get down to 70 or below I need to reimplement it entirely with a different approach or algorithm. In a non-public-solution competition, I would realize that and start from scratch aiming for a different approach. However, with your code being public, and I having seen it while looking over the contest, I am strongly motivated to not simply copy your code. So instead of seeing a dozen competitors with very similar solutions as in historical perl golf competitions, we see most people here stop where their solution is most unique, even when they aren't winning.

  2. Our framework doesn't provide any concise and consistent method for scoring different languages independently. I am a lot less motivated to compete in the languages that I am familiar with (even though perl is classically a good golfing language) when I know that I will [almost] never come close to the scores being produced by the CJam and GolfScript and Pyth golfers. When codegolf.com was active they made a point of emphasizing the top score in each language.

\$\endgroup\$
6
  • 5
    \$\begingroup\$ The 2nd point is the most important to me. There are tons of times where I see a problem I can solve in 40-60 bytes, but someone made a Pyth answer with only 17. This is a kick in the motivation! \$\endgroup\$ Commented May 11, 2015 at 13:39
  • 3
    \$\begingroup\$ Which brings up the question whether we should use these languages at all, or whether "least amount of characters" is even a good method of scoring. "Using a made-up language specifically designed for the challenge" is considered a standard loophole, but using "my general-purpose stack-based toy language™" is fine, apparently. I've ranted about this quite a bit in chat though and no one seems to agree with me, so I'll stop here. \$\endgroup\$
    – Flonk
    Commented May 16, 2015 at 9:54
  • 2
    \$\begingroup\$ @Flonk It generates reputation. I must say that I was in the way of making a golf language, but I gave up from it. It proved to be a total failure. Also, people seem to like it. So, more golfing languages will grow, that can do most of the challenges in fewer bytes. I'm not saying "Don't use Pyth. Pyth ruined this website!". I'm saying: "My determination to even try to solve a problem goes down the drain when I golf with a real-world language because someone made a Pyth answer that is smaller than I could ever accomplish with said language.". \$\endgroup\$ Commented May 19, 2015 at 20:10
  • \$\begingroup\$ A potential method of working around these two issues can be as follows: Encourage language-specific challenges. This does not mean that other languages will be forbidden to participate, it only means that only submissions in a specified language will be accepted. Other submissions can still be upvoted, but no matter how short they will not "win" the challenge. (Works around no.2 if sufficient challenges of this type for different languages are written.) Golfers are then encouraged to use the spoiler markup for thier submission if they are using the specified language (works around no.1) \$\endgroup\$
    – user12205
    Commented May 21, 2015 at 13:02
  • \$\begingroup\$ (P.S. I just realised that using code blocks in spoiler is a pain in the neck. My previous comment may not be practical unless this totally broken thing is fixed.) \$\endgroup\$
    – user12205
    Commented May 21, 2015 at 13:25
  • 1
    \$\begingroup\$ I like your second point. \$\endgroup\$
    – user9206
    Commented Jun 18, 2015 at 13:38
13
\$\begingroup\$

I want to propose a community event where we, every month or so, spotlight one golf challenge to focus our attention on, with bounty prizes for per-language winners.

This would entail:

  • Writing up a flawless spec, Fortnightly Challenge style.
  • Finding sponsors willing to put up bounties for at least the 5 most common golfing languages.
  • Posting the challenge with a per-language leaderboard and a deadline.

I foresee some issues:

  • Getting people willing to donate rep.
  • Awarding winners in collaborative work, like where someone suggests an improvement to someone else's code.
  • Spec ambiguities and judgment calls.

Would this interest people? Can we make it work?

\$\endgroup\$
12
  • \$\begingroup\$ This could potentially work if we find enough people willing to donate their rep for it. I wonder if it would be better to choose a question that has already been posted. Advantage: We'd already know if it's a challenge with the right amount of depth for something like this to be interesting. Disadvantage: It might see less activity than if it was a fresh challenge, explicitly written for this purpose. \$\endgroup\$
    – Martin Ender Mod
    Commented May 9, 2015 at 11:01
  • 1
    \$\begingroup\$ I've never tried it, but I suspect that you can't create a second bounty while one is already active. And you can't award a bounty until at least 48 hours have passed. So it would take more than 10 days, and careful coordination, to distribute 5 bounties. \$\endgroup\$ Commented May 9, 2015 at 13:35
  • \$\begingroup\$ But, aren't the "5 most common golfing languages" most likely the languages that have golfers who appreciate the answers? \$\endgroup\$
    – jimmy23013
    Commented May 9, 2015 at 15:01
  • \$\begingroup\$ @PeterTaylor Yes, only one bounty can be active on per question at a time. (Just check a bountied question - there's no "start a bounty" link at the bottom.) Also it would technically only take a week, because I think bounties can be awarded 24 hours after they were started (not that 7 or 10 days really makes a difference). \$\endgroup\$
    – Martin Ender Mod
    Commented May 9, 2015 at 15:48
  • \$\begingroup\$ What would the "5 most common" languages be? And what if the best scoring program overall isn't written in one of those languages? \$\endgroup\$ Commented May 10, 2015 at 15:19
  • 1
    \$\begingroup\$ @ASCIIThenANSI That's the point. This isn't about the best overall program, because comparisons between languages aren't really that meaningful when it comes to squeezing out every last byte. Hence the suggestion is to promote competition within languages. Of course, which languages to pick is a different matter. \$\endgroup\$
    – Martin Ender Mod
    Commented May 11, 2015 at 0:41
  • 1
    \$\begingroup\$ @ASCIIThenANSI You're right that it's not ideal that unpopular languages, which would benefit the most from this, are unlikely to a bounty to create a competition for that language. Still, if there's a language you want to be included, you could pay a bounty to start it. \$\endgroup\$
    – xnor
    Commented May 11, 2015 at 1:14
  • 4
    \$\begingroup\$ Does this take into account that fact that each bounty on a question has to be for more than the previous one(s)? \$\endgroup\$
    – Geobits
    Commented May 11, 2015 at 13:15
  • 2
    \$\begingroup\$ What if instead of top 5 programming languages, we had "categories"? As an example, we could have golfing languages (Pyth, CJam, GolfScript), regular languages (Perl, Python, C/C++/C#), hard-to-use (Brainf**k?), etc. \$\endgroup\$ Commented May 11, 2015 at 14:17
  • \$\begingroup\$ @Geobits Maybe we take the best answers across 3 different languages, then award bounties to 3rd, 2nd, and 1st place, in that order. For example, if we had Python - 35, Python - 40, Perl - 55, and C++ - 65, then we award bounties to the C++, Perl, and 35-point Python answers (the 40-point Python answer is ignored because it's the same language.) This way, the smallest is given to 3rd place, and then the bounties increase the better your score was. The reason it has to be 3 different languages is so if you don't make the best overall, you can still get a smaller 'prize'. \$\endgroup\$ Commented May 11, 2015 at 14:22
  • 2
    \$\begingroup\$ @Geobits I think that's only if they are offered by the same user. (In which case it's not just "more than the previous one" but the minimum doubles each time I think.) \$\endgroup\$
    – Martin Ender Mod
    Commented May 13, 2015 at 6:24
  • \$\begingroup\$ @MartinBüttner Ah, that makes it a bit different. I knew about the doubling, but not that it was only for your own previously bountied Qs. \$\endgroup\$
    – Geobits
    Commented May 13, 2015 at 12:47
11
\$\begingroup\$

Dueling

Ever since Dave threw down the gauntlet which sparked a friendly Java vs C showdown, I've been pondering the idea of having a formal avenue for these 'mini-challenges'. If this were to happen, the duels would be a fun way to inspire meticulous golfing. The two individuals (possibly with help from spectators) would go back and forth, creating two meticulous solutions for a particular challenge at no cost to the community.

What it is

A duel is an arranged engagement in combat between two individuals with matched weapons in accordance with agreed-upon rules. Used to gain "satisfaction", that is, to restore/defend one's honor.

In this context, it would be a duel between two golfers. There is a challenger, who throws down the gauntlet and there is the champion who accepts the challenge.

How it works

  • Challenger specifies:
    • the question
    • his language
    • his opponent's language
    • time frame
    • rep
  • Champion
    • chooses to accept the challenge
  • Outcome
    • after the time frame
    • based on the question's winning criterion
    • the better of the two answers wins
    • the victor receives a bounty for the rep amount

Implementation

How do we make this happen? We could have a 'List of Duels', similar to our 'List of Bounties'. Challengers can post duels, champions can comment their acceptance, spectators can follow the links and assist.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Myself and Riley often have duels in Brain-Flak that are quite fun. Example \$\endgroup\$
    – Wheat Wizard Mod
    Commented Mar 24, 2017 at 17:05
  • \$\begingroup\$ I really like this idea. It'd be fun to do some duels. \$\endgroup\$
    – user45941
    Commented Mar 24, 2017 at 17:09
  • \$\begingroup\$ @WheatWizard Intra-language duels would be more sticky. Ties would be more likely, copying could be a problem and spectator involvement could become more political (e.g. Why comment on her answer and not mine?). With reputation on the line, people could get bent out of shape on details like that. I also think that the competitors would be more inclined to give each other suggestions and be helpful in an inter-language duel. So overall I'd avoid formal intra-language dueling. \$\endgroup\$ Commented Mar 24, 2017 at 17:42
  • \$\begingroup\$ Some of the most fun code-golf for me has been Java/C# duelling, I'd love for this to be encouraged and it would certainly motive going 'the extra mile' on an otherwise typical answer. Issues would be convergence of answers (though sometimes it's fun to see the minute difference between languages), and well defined answer validity (shameless reference to codegolf.meta.stackexchange.com/questions/11223/… which despite a slight consensus has no appearance 'in the wild'). Either way, I always welcome competition from Java (being a C#er) \$\endgroup\$ Commented Mar 26, 2017 at 2:34
  • 4
    \$\begingroup\$ @VisualMelon Competition between Java and C#? C'mon, everyone knows that's no competition ;) \$\endgroup\$
    – Geobits
    Commented Mar 27, 2017 at 10:05

You must log in to answer this question.

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