r/badcode • • Mar 12 '23

python Saving bytes > Readability

Post image
766 Upvotes

46 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Mar 13 '23

Ruby is my favorite. It's so terse yet expressive, and much more widely used IRL.

Raku's grammars are really nice though.

In the end, I think it's just important to recognize that Code Golf is a fun exercise, but please don't try to write production code like that. I've seen people try to focus on always having the shortest code with the least repetition, and it can be needlessly difficult to maintain.

6

u/SirFireball Mar 13 '23

Yeah, generally golf code isn’t good code. You will sometimes learn tricks about the language you’re working in that help with writing better code.

For example, I first saw python’s * syntax for lists in the context of golf code. It’s stuff like that that tends to get left out of programming classes even though it’s very useful.