# Can and should we encourage more meticulous golfing?

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.)

• 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. – Doorknob May 7 '15 at 21:41
• 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. – Rainbolt May 7 '15 at 21:41
• @Rainbolt I'm giving my opinion of course, but I am asking the question. Are you suggesting I do this differently? – xnor May 7 '15 at 21:45
• 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. – nderscore May 11 '15 at 1:27
• This reminds me of this answer I posted – aditsu May 30 '15 at 18:50

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.

• 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! – Ismael Miguel May 11 '15 at 13:39
• 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. – Flonk May 16 '15 at 9:54
• @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.". – Ismael Miguel May 19 '15 at 20:10
• 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) – ace_HongKongIndependence May 21 '15 at 13:02
• (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.) – ace_HongKongIndependence May 21 '15 at 13:25
• I like your second point. – user9206 Jun 18 '15 at 13:38

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.

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?

• 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. – Martin Ender May 9 '15 at 11:01
• 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. – Peter Taylor May 9 '15 at 13:35
• But, aren't the "5 most common golfing languages" most likely the languages that have golfers who appreciate the answers? – jimmy23013 May 9 '15 at 15:01
• @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). – Martin Ender May 9 '15 at 15:48
• What would the "5 most common" languages be? And what if the best scoring program overall isn't written in one of those languages? – ASCIIThenANSI May 10 '15 at 15:19
• @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. – Martin Ender May 11 '15 at 0:41
• @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. – xnor May 11 '15 at 1:14
• Does this take into account that fact that each bounty on a question has to be for more than the previous one(s)? – Geobits May 11 '15 at 13:15
• 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. – ASCIIThenANSI May 11 '15 at 14:17
• @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'. – ASCIIThenANSI May 11 '15 at 14:22
• @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.) – Martin Ender May 13 '15 at 6:24
• @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. – Geobits May 13 '15 at 12:47

## 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.

• Myself and Riley often have duels in Brain-Flak that are quite fun. Example – Wheat Wizard Mar 24 '17 at 17:05
• I really like this idea. It'd be fun to do some duels. – Mego Mar 24 '17 at 17:09
• @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. – NonlinearFruit Mar 24 '17 at 17:42
• 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) – VisualMelon Mar 26 '17 at 2:34
• @VisualMelon Competition between Java and C#? C'mon, everyone knows that's no competition ;) – Geobits Mar 27 '17 at 10:05