4 ms·
Code golfing may seem like just a fun nerdy "sport", but it's actually really useful practice in keeping your code terse and your unnecessary abstractions to a
by Deestan 16y ago
Code golfing may seem like just a fun nerdy "sport", but it's actually really useful practice in keeping your code terse and your unnecessary abstractions to a minimum.
I recommend everyone to try to do really well in a few code golfing challenges.
http://codegolf.com/ http://codegolf.com/ also accepts a couple more languages than PHP if that's not your style.
- seles 16y agoand http://golf.shinh.org/ http://golf.shinh.org/ accepts even more languages (80) but it is 'less refined'
- noodle 16y agoat least the 99 bottles challenge looks to be a direct ripoff of codegolf. or vice versa.
- photon_off 16y agoI would disagree. There's a point where code terseness and abstractionlessness come at the cost of code readability, and these competitions cause you to go way beyond this point. There's no sense in practicing how to write confusing code that is very short, other than the problem-solving aspect of it. I think code golf is just another form of a puzzle. So, whatever benefit you get from solving a puzzle, or mind bender, or whatever, you'll get from code golf. Hopefully you'll have the sense not to golf production code.
- Deestan 16y agoI said "practice in keeping your code terse". Actually trying to golf production code would just be insane. Programmers commonly put in completely unnecessary abstractions "just in case", and a golfing mindset will help you avoid a lot of these.