DEV Community

Cover image for Answered: What the Heck is Code Golf? ⛳

Answered: What the Heck is Code Golf? ⛳

Andrew Healey on March 30, 2019

Usually, code golf means one of two things: The act of shortening a section of code. A wonderfully obscure community on the internet who compete ...
Collapse
 
tobiassn profile image
Tobias SN

The problem with code golfing is that some people have created their own language to use for it, which means they can add new behavior specific to a single challenge, so any answers they post could be just 1 character, which could allow for thousands of different ‘opcodes’.

Collapse
 
healeycodes profile image
Andrew Healey

That’s a really good point, Tobias. For anyone who may not know, there is a rule that stops languages being developed/edited after a challenge has been posted. But I believe what you’re referring to is where people have thought about the common challenges that do arise and are solving them with 4-5 hard to follow UTF-8 characters. I agree with you on some level that this is a problem. However, there has been an evolution in challenges to match this — questions that specifically make it hard for golfing languages to compete. For instance, Paint Starry Night, objectively. I think as long as people are explaining their process (and language) I remain thoroughly interested. For instance, this Jelly answer to ‘How high can you count’.

Great comment 👍.

Collapse
 
thomasrayner profile image
Thomas Rayner

Code golf is the best way to learn the worst parts of a language :D

Collapse
 
healeycodes profile image
Andrew Healey

Very true!

typeof NaN; // -> 'number' 😀

Collapse
 
zacharypatten profile image
Zachary Patten

Do you by chance have any recommendations for re-occuring C# code golf websites? Most golf websites I see don't support C#. :(

Collapse
 
healeycodes profile image
Andrew Healey

Sorry, I haven't come across any code golf websites where C# is overly popular. Stack Exchange still has a little C# content. Answers on that board are warmly welcomed no matter what the language is 👍

Collapse
 
jessicajhon profile image
jessicajhon

I want to use this code for my website which is related to golf
accessories. How can I use this code for this website? Please do let me know.