# Why I am leaving Code Golf

The contents of this post are solicited opinion that I have been asked by a Code Golf moderator to share with you. I understand "If you don't like it, then GEETTT OOUUTT" applies here, so I have already submitted my account for deletion.

I joined Code Golf because the challenge of fulfilling certain criteria in the most terse possible syntax seemed awesome. Hacking languages to make them do stuff they weren't meant to in new and creative ways? Sign me up!!

Whoa then, what's this? Somebody posted a solution in a language I've never heard about, and solved the problem in 10 characters. Cool! Fifteen minutes of Wikipedia brings me up to speed on esoteric programming languages and I have a good laugh that someone went through all sorts of trouble to make a language that is basically useless except for getting a few tasks done in a very cryptic, dense syntax.

The next day, I log back into Code Golf and, oh look, that esolang has the top answer again. 4 bytes. Let's scroll down and... another esolang does it in 3 bytes. 5 bytes... Ok... getting old. When the solution language is designed for the exact problem, we are no longer hacking anything.

Analogy problem: Bake a moused-shaped cookie in as few steps as possible. Solutions:

1. Foil (15 steps), 2 upvotes: I shaped a piece of foil in the shape of a mouse and put the cookie dough inside.
2. Knife (9 steps), 5 upvotes: I baked a normal cookie, then cut a mouse out of it using the following technique...
3. MseShpdCttr (1 step), 25 upvotes: I used this device called MseShpdCtter that takes a lump of dough and shapes and bakes and spits out a mouse shaped cookie.

Using a specialized device to solve a specialized problem isn't fun after the first few times. Seeing people solve problems in Java, Javascript, PHP, C++, ..., and having others comment on it and find hacks to shave bytes is amazing. I really like that aspect of this community.

But the fact is every Code Golf thread is dominated by these esolangs and makes it really not fun to see a "competition" with the languages listed above. Yes, I know there is supposedly a winner for each language, but the fact is this is Stack Exchange and the top responses get the most focus. The current system is not suited for "there is one winner per programming language", and the people actually hacking up answers are at the bottom of the (fifth) page.

The line was finally crossed when I saw a Hello World challenge and the most upvoted response was a zero-byte solution in some language that prints Hello, world! with no input or code. That's not interesting. That's not hacking. For me, that's not fun.

I wish I had novel suggestions to improve this site. "Specify the language" doesn't seem like it would get enough independent responses. no-esolangs and esolangs-only tags are arbitrary. Maybe something like restricting answers by default to the top 10 most used languages on GitHub at the time or something would work, but there is a very real chance that is not in line with the community's zeitgeist.

Like everything, Code Golf isn't perfect. I can think of other ways this site can be improved and could be hashed out with the community and morphed into implementations we all benefit from. I think other people are sharing ideas on Meta with that purpose in mind. However, all of this is drowned out by the problem detailed above, and I don't see the point of working out details of improvements when Code Golf's foundation is fundamentally flawed.

So, because I cannot think of any feasible ways to help this community improve, I am just going to leave. I hope one day somebody here figures out a way to isolate the MseShpdCttr solutions from the ones utilizing universal tools, but until then farewell.

• The line was finally crossed when I saw a Hello World challenge and the most upvoted response was a zero-byte solution in some language that prints Hello, world! with no input or code.. That was my answer. Sorry that it convinced you to leave the site, I will give my opinion on the issue you are bringing up when I have time as an answer to this. – Fatalize Sep 14 '15 at 13:26
• I have on occasion mooted the opposite to what you asked in that thread: I would prefer PPCG questions not to appear in the hot network questions, because it seems to me that the ones which do appear there are often either the lowest quality or the most trivial questions on the site, and they give people a bad first impression. – Peter Taylor Sep 14 '15 at 13:31
• With respect to the esolangs, the majority of code-golf questions are dominated not by esolangs which are specialised for the problem at hand but by general-purpose esolangs which are specialised for golf. If you saw mainly questions where they provided solutions in six or fewer characters then you were looking mainly at trivial questions. There are more interesting questions around, where really golfing a CJam or GolfScript answer takes several hours. – Peter Taylor Sep 14 '15 at 13:34
• Do you consider APL an esolang? And there are many CJam and Pyth users on this site, I think that's the reason they usually get quite a few upvotes. Not every new esolang can do well. And not every new CJam user can golf well in CJam. But if a challenge can be solved in 3 bytes, that probably means it is really a bit easy. – jimmy23013 Sep 14 '15 at 13:47
• Esolangs, both specialized and general, were here before you were. They will be here long after you leave. With that in mind I ask you: How did you ever have fun? What changed that made you stop having fun? – Rainbolt Sep 14 '15 at 14:01
• Your answer MseShpdCttr to mouse-shaped cookie is misleading in a sense that it suggests that we encourage languages which are specifically designed to perform the task with an inbuilt. Here's the deal - Most of the times, we forbid inbuilts that perform the task (but its still upto the OP though). Secondly, any submission using a language feature created after the question makes the submission invalid for acceptance, so things like, hey, let me create an esolang that solves this task in 1 byte are forbidden. – Optimizer Sep 14 '15 at 14:01
• Also, the zero byte "Hello World!" thingy is kind of a loophole that the user read the question posted on Sandbox and implemented a language to have the feature in built before the question was posted on main. We had a short discussion going around this particular loophole, but I am not sure if a consensus was made or not. EDIT: looks like a consensus was made as posted by Rainbolt below V – Optimizer Sep 14 '15 at 14:03
• @Optimizer It has support: meta.codegolf.stackexchange.com/a/5772/18487 – Rainbolt Sep 14 '15 at 14:05
• As for the Hello World challenge, I didnt see it as a loophole when I posted since a) there is no winner and b) it was encouraged to catalogue answers in every language. I got a lot of reputation with this answer, true, but that's really just reputation. – Fatalize Sep 14 '15 at 14:17
• "I have a good laugh that someone went through all sorts of trouble to make a language that is basically useless except for getting a few tasks done in a very cryptic, dense syntax." One thing I'd like to add that doesn't justify a full answer: several users (myself included) are regularly using at least CJam outside of golfing. It's a very powerful general-purpose language, and if you're writing a quick throwaway script which no one other than you will read and where typing speed is the bottle neck, having terse syntax is actually a benefit. CJam has definitely improved my productivity. – Martin Ender Sep 15 '15 at 14:30
• I understand your argument, but to echo other users, I don't think it should be all about winning. I first used the codegolf challenges here as a mechanism to help me become more familiar with Perl when I started a new job where it was the primary language. I've been using the challenges here to help me improve my understanding of the language itself, what I can do with it, explore the syntax and push it to unreasonable limits. I find what others are able to do in any language interesting and reading through solutions I can in-turn learn about any languages I'm currently learning. – Dom Hastings Sep 18 '15 at 23:03
• Make a userscript to not show esolangs – Redwolf Programs Sep 4 '18 at 16:10

This answer assumes you have golfing languages in mind when you refer to esolangs. If you are actually referring to languages specialised for specific problems, then these are heavily discouraged in most cases*.

I'm sorry to hear you're leaving. This issue has been raised before, and I can sympathise with you in that I don't find languages with abbreviated syntax particularly interesting (in and of themselves). In over 3 years, I've never posted in CJam/Pyth/GolfScript - I stick with Python most of the time, and occasionally post in other 'normal' languages.

However, I have found that voters tend to side with cleverness and creativity over the number of bytes. In my experience, a clever solution in a standard language (like Python, JavaScript, C or even Java) will always outscore straightforward answers in golfier languages.

But I think you are missing the converse. An answer may be written in a standard programming language without being new or creative. In fact, many answers in common languages are quite poorly golfed. On the other hand, answers written in golfing languages can be amazingly creative and hack-y, especially since expert golfers tend to use these languages.

tl;dr - if you post a clever answer and explanation, you'll be upvoted regardless of language.

* As for the hello world question, it is unique - even boring answers in normal languages (e.g. print"Hello, World!") have 10-20 upvotes. And you mentioned answers sitting at the bottom of the fifth page - questions with five pages of answers aren't a fair representation of PPCG either.

• +1 for clever answer and explanation. No-one's going to appreciate your clever answer if you don't explain it. – Level River St Sep 14 '15 at 21:21
• Although your answer seems to represent some kind of consensus (similar questions have been asked on Meta), I wonder: is it actually true that clever-but-longer answers are upvoted quite as much? Is this something everybody experiences, or is there a chance that your answer only describes how it should be? Could you perhaps give some (recent) examples? – Sanchises Sep 15 '15 at 13:50
• @sanchises a bit of both. I'd say the voting is weighted towards shorter languages, but clever answers with explanations are (almost) always well rewarded. I haven't been very active recently, but answers with interesting explanations seem to be highly voted. For more examples, look at answers by high rep users who don't often use golfing langs (e.g. Geobits, edc65 and myself). – grc Sep 15 '15 at 15:02
• @sanchises my most voted answer: score 164, votes 66. Accepted answer to the same question, CJam, score 103, votes 7. codegolf.stackexchange.com/a/40232/21348, And the same for many other answers of mine – edc65 Sep 16 '15 at 19:31
• @edc65 I'm glad to hear that. However, I'm also glad I seem to have kicked off some discussion point, quote grc 'a bit of both'. Perhaps the real question is: how can we promote interesting answers with corresponding upvotes, rather than if we can/should do so. – Sanchises Sep 16 '15 at 22:14
• I usually post ridiciously long brainfuck answers to code golf questions. So, yeah, as long as your answer and/or explanation is interesting, you'll get the votes - but in the end it̶ ̶d̶o̶e̶s̶n̶'̶t̶ ̶r̶e̶a̶l̶l̶y̶ ̶m̶a̶t̶t̶e̶r̶ they are just internet points. – mınxomaτ Sep 22 '15 at 15:23
• Allow me to disagree. You can come up with a super ultra heartlbreakingly tiny answer, but if someone else uses Pyth or CJam, said user gets all the upvotes. Here's an example: codegolf.stackexchange.com/q/54498/14732 (Yeah yeah, I know, it's closed). Regular languages have between 0-2 upvotes, while golf languages have 5+ upvotes... So, yeah, almost everybody care about byte count. Another example: codegolf.stackexchange.com/q/53812/14732 (the most voted answer is a Pyth answer!!!) One more: codegolf.stackexchange.com/q/52257/14732 Top answer is... CJAM x 3!!! – Ismael Miguel Sep 25 '15 at 11:07
• In addition to the factors already mentioned, I would say voting is weighted toward popular languages. Longer answers that garner lots of upvotes tend to be in languages like Python, Java, BF, and Retina (etc.), which a lot of users on this site are familiar with. Less-popular languages, often not so much. Furthermore, a longer answer in CJam or Pyth will frequently get more upvotes than a shorter answer in a less-known golfing language. (E.g. codegolf.stackexchange.com/a/50892/16766, though the FGITW effect is also at work there.) – DLosc Sep 26 '15 at 6:21
• @edc65 Your answer is really interesting, but it only proves that no one cares about how interesting it is or the use of things in a way they weren't meant to be used. My answer on the same question (codegolf.stackexchange.com/a/40229/14732) uses an obscure feature of PHP that allows me to save 1 byte. And it got only 3 upvotes. So, yeah, the answer has to be interesting, as long as it is CJam, Pyth, APL or Golfscript. – Ismael Miguel Sep 27 '15 at 19:00
• @DLosc PHP is quite a popular language and answers in that language get few upvotes. – Ismael Miguel Sep 27 '15 at 19:01
• @IsmaelMiguel I strongly disagree and dont'see the need of all those exclamation marks (APL... yeah...). To the point: anyone can cite some answer, but anedoctical evidence is worthless. We could try to get some real data with some query (not that I really care...) – edc65 Sep 27 '15 at 19:47

I joined this site 85 days ago, with no "code golf" experience at all, so I'm relatively new to all of this.

I kind of understand the reaction you have against (I assume) languages like CJam and Pyth notably, which win almost every code golf challenge on this site. Users like @Dennis will always be on top of the rep chart because they answer everything in those languages.

Similarly I can understand how you got frustrated seeing my answer for the Hello World! challenge get more than 100 upvotes, when it doesn't even contain any code at all.

On the other hand, I think you are underestimating the efforts it takes to produce those CJam/Pyth answers. Its' true that they have very powerful 1/2 bytes operators, but as far as I know (never learned those languages, so correct me if I'm wrong), they are still relatively general purpose languages and they don't really have super-specific operators that are useful for a particular challenge. Having a one byte operator to generate all possible subsets of a list may seem like cheating, but it's really not that convoluted of an operation.

Moreover, answers by the best users of those languages are usually pretty well explained, and sometimes display remarkable tricks to save some bytes, which in themselves are sufficient arguments to justify their presence on this site.

But the most important point I think is that you care too much about who wins the challenge, or what trick is interesting.

Seeing people solve problems in Java, Javascript, PHP, C++, ..., and having others comment on it and find hacks to shave bytes is amazing.

I don't want to generalize too much since I don't have that much experience here, but from what I've seen the most interesting "hacks" are usually actually from those "esolangs" rather than general purpose languages, because you either have a plethora of different operators that can help you solve the problem in a very different but shorter way, or because the esolang is so esoteric that very ugly solutions are possible. Languages like Java don't really have both options and they usually end up being not the most interesting answers, even if we don't pay attention to the bytes count.

Finally, while it's true that CJam/Pyth are very often at the top of answers, and are almost always the winners of challenges, it's also true that a lot of languages that are bad at golfing usually get very respectable upvotes/scores.

APL or J for instance, while they still may look like noise, are languages that were not designed for code golfing, yet can usually yield very short answers.

Python and Ruby are probably the two "standard" languages that I see the most on this site, and they usually do pretty well and display very interesting tricks often. I'm surprised you have not talked about answers in those languages in your post, because to me they seem to be both popular and numerous.

Finally, my own answers are almost all in Prolog, which is an absolutely godawful language for code golf (can't really do any hacky things, very long built-in names, declarative paradigms forces you to make a lot of things explicit, etc.). But I still keep using it because a) I learnt a lot about Prolog using it and b) I love trying to golf the logic of the problem with respect to the way Prolog tries to unify things. This answer is ahead of Pyth, while considerable longer, so even godawful languages can "win" challenges in a sense.

I even started writing my own esolang called Brachylog which is to Prolog what Pyth is to Python (except way worse, but you get the idea). So that's one more reason for you to hate me I guess, but I find it rewarding to actually use a language I designed (on the spot, but still).

In conclusion, yes some languages like CJam or Pyth will win most challenges, but I don't think they are aggregations of ultra specific operators, they can still be beat in specific cases by other languages that were not designed for golfing. Answers in "normal" languages like Python or Ruby seem very popular and numerous to me which is something you should like, and even awful languages can get a good number of upvotes regularly.

EDIT One last thing that I forgot to mention is that you can appreciate the quality of some questions on this site rather than the answers themselves. A lot of my reputation comes from the questions I actually asked rather than my answers, which is also more satisfying.

• "Users like @Dennis will always be on top of the rep chart..." because he has a ton of answers, not simply because he uses CJam or other esolangs. He has 387 answers in the code-golf tag and a score of 2623 for it, so 6.7/answer. I answer almost exclusively in Java and have an average of 6.4/answer in the same tag. He's on top of me in rep because he's answered about seven times as many. – Geobits Sep 14 '15 at 14:28
• @Geobits True, I'm not trying to say that Dennis doesnt deserve his rep on his answers, simply that users like him will tend to have more validated answers and upvotes using those languages. If anything it shows that those languages are not even that much more favored by voters compared to things like Java. – Fatalize Sep 14 '15 at 14:33
• Yea, that's what I mean to say. Non-esolangs get plenty of love here, but if you only look at the the "hot" questions where something weird gets runaway votes, you won't see it. The long-term trend is fairly clear. – Geobits Sep 14 '15 at 14:35
• If I could upvote multiple times, it would be for this answer. Codegolf isn't about "winning", it's about the challenge! Sure, my JavaScript answers will 99% of the time lose to Pyth/CJam, and sure, my Hello World answer that took 5 seconds to write will be my most popular, but does that take away the challenge? No! – jrich Sep 14 '15 at 14:39
• Ultimately, if you golf in a language that you use daily, you will have a learning effect. You start to see shortcuts, simplifications and improvements to both code and underlying math. That is the best reason (at least IMHO) to not use a language made for golfing :-) – mınxomaτ Sep 14 '15 at 16:54
• @minxomat unless you are Dennis, who uses CJam for everything, not just golf – trichoplax Sep 14 '15 at 22:04
• @minxomat I actually feel the opposite. In code golf, the goal is to use the language in often awful ways just to save a few bytes. Doing that with a language that I use professionally pains me, because I have to use exactly the opposite of what I consider good practices. With a golfing language, it feels like I use the right tool for the job, instead of misusing a language that really wasn't intended for this purpose. – Reto Koradi Sep 16 '15 at 4:12
• @RetoKoradi Good practice and what I meant are two different things. Of course you should never actually write code like this, but thinking of ways to improve your code (from something simple like order of exec. to more advanced running time analysis) implies a learning effect. I've once hosted a competition similar to "golfing" for a few years and both novice as well as advanced programmers learned a few tricks they repeatedly used in future code (Speed improv,, simplific. etc.). (while maintaining or improv. code readability). But that is just my experience :). – mınxomaτ Sep 16 '15 at 4:22
• @trichoplax - or, more recently, Jelly: a language he made. – Geza Kerecsenyi Aug 8 '19 at 19:07

I joined this site only 51 days ago, with no "code golf" experience at all, similarly to Fatalize. I understand that you feel "robbed" by the Pyth/CJam answers. It's very hard, and sometimes impossible, to create something shorter in other, more "standard" languages. But that doesn't have to take away the fun of solving challenges with these languages.

Since I joined, I've used Javascript in practically every answer I have posted, and I've thoroughly enjoyed golfing each and every one of them. Some of them are near the top, and one is the most up-voted answer, even though they are by no means the shortest.

But the fact is every Code Golf thread is dominated by these esolangs and makes it really not fun to see a "competition" with the languages listed above.

It's true that these languages are dominant in the realm of "who can write the shortest code?", and this could take away the fun of answering in "standard" languages. But it doesn't have to. The reason I continue to participate in code-golf, though I don't often win, is because I like to see how short I can get my answers in my favorite language (currently JS). For the same reason, Martin Büttner's amazing leaderboard template not only has an overall leaderboard, but a per-language leaderboard.

I guess my main point is that the primary goal of code-golf, as with any other recreational activity, is to have fun and improve your skills, not just to win as many challenges as possible. It's not a prize-paying championship; there's nothing you're missing out on by not using these golf-optimized esolangs. So if you'd like to try answering a challenge with C++ or PHP or JS or Java, go right ahead; there's no one holding you back, and no one who's going to criticize you just for doing so.

One final thought: I've found that instead of just looking at the water and deciding it will feel cold, it's best to go down a few steps and see how it really feels. You just might like it. :-)

Good luck!

• One should point out that if you search for answers, sorted by votes, none of the top answers on the site are 'golfing languages'. – user12166 Sep 21 '15 at 22:36
• @MichaelT Yes, that's a good point, but one should also point out that all of those answers are on popularity contests. – ETHproductions Sep 22 '15 at 0:04
• Then the second page of 30 would be where to look, with C64 basic, Polyglot, Befunge, Python and more python. I would also point out that I believe people are hung up too much on CJam vs a "non-golf" language. I look to the perl vs python grudge match, and the CJam vs Pyth "leagues" (with the occasional APL wildcard pick). The number theory question that I just pulled up has Java (270 bytes) at +9, Python (170) bytes at +5, R (141 bytes) at +5, Pyth (81 bytes) at +4... Who cares if Pyth has half the byte count of Python, Python is beating Perl - thats the golfing I watch. – user12166 Sep 22 '15 at 0:26
• @MichaelT Ah, yes, I love watching these language-vs-language battles too! I get the most fun out of challenging myself to beat that Python answer 6 bytes shorter than mine, that Perl answer 14 bytes shorter, that other JS answer with a different technique. Like I said, it doesn't matter that you have the shortest answer, it matters that you have fun and gain experience in the process. – ETHproductions Sep 22 '15 at 2:47
• Looking at code-golf answers only, about half of the top 50 answers are "normal" languages. – user2428118 Jan 16 '17 at 16:36
• @user2428118 Isn't half-half good? – MilkyWay90 Aug 21 '19 at 19:31

To be honest, I don't really see the problem. Code golf is about writing shortest entry in any language that is accepted. People created some strange languages to be able to write short programs. Some people learned it and use it.

While I understand that seeing all these "exotic" answers might be bugging you, I also think that your approach is wrong(but if you don't like it, you are doing the right thing leaving - it's your decision, and it's perfectly fine).

First of all - answers in CJam or Pyth tend to be creative. They use some different approach to the problem to minimize characters. I like that.

Secondly, code golf is all about fun. If you get the shortest entry, you don't win a cookie. You just get the shortest entry. It's literally meaningless, so why care? If you wrote some brilliant entry, people might appreciate that and you can feel good, but that's it. We're here to have fun, and being too focused on winning is bad.

And if you're so inclined for winning - remember that programming is not only the ability to use X programming language - it's about being able to use the right tool for the job. If you want to make simple operations on text file, you use sed or awk. If you want to find something in file, you use grep. You don't go for C++, because it's not the right tool for the job. When the job is Code Golf, the right tool is often CJam/Pyth/another esolang.

With this in mind, I often see many answers in "mainstream" programming languages that are really short and impressive. And I think this is what Code Golf is about.

Anyway, good luck! I hope that you either stay here and enjoy it, or go and find some other place where you can enjoy programming whatever you want.

• Just when I thought I would be getting cookies... :( – Alex A. Sep 15 '15 at 17:24
• If the cookie analogy had any modicum of truth, we'd be shutting down all the code golf questions for subjective winning criteria. – tuskiomi Jun 23 '17 at 14:44

Just compete with yourself and others using your language. Forget about the rep you earn. I enjoyed answernig a leap-year challenge using z/OS assembler and then seeing exactly how short I could get it. I play CoD online too and my kill/death ratio is always less than 1 - I'm not going to compete with the guys who get to play all day every day and just enjoy the game and getting a few good kills.

I sympathise. I haven't contributed yet but I sometimes look at the answers and find the ones in conventional languages much more interesting and useful.

Suggestions

1. Downvote if you don't like an answer. Leave a comment saying why you downvoted. Hope that others will upvote your comment and downvote the answer.

2. If you ask a question and do/don't want certain languages then specify that in the question. Make a list of acceptable languages and paste it in each time.

• Re 1. if you encourage downvotes, please encourage them for boring solutions, not for languages you personally dislike. Re 2. Limiting the admissible languages for a challenge is very much discouraged on the site. Saying "I don't like your language, you can't participate" isn't really nice. Especially since these lists will always be completely arbitrary. And once you disallow CJam, GolfScript and Pyth, you'll get the same complaints about the (non-golfing languages) APL, J and K. And when you start disallowing those people will complain that they can't beat Perl. – Martin Ender Sep 15 '15 at 14:24
• 1. That's why I say leave a comment. It allows the community to think about the reasons and respond. In any case, a downvote is always for personal reasons in the end. We all have our different opinions. 2. You may be right. Drawing a line is always arbitrary. However I presume it would be possible to have a question that challenge users in just one language. That way it's a level playing field. – chasly - supports Monica Sep 15 '15 at 14:40
• there are some cases where challenges makes sense in one specific language. But those are very rare exceptions. With a standard code golf, there's no reason to say, "only Python answers are allowed". Because then we'd get the exact same challenge for every single language we can think of, because the same challenge with "only Java answers are allowed" would be just as valid. – Martin Ender Sep 15 '15 at 14:43