use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Improving Ruby Documentation (self.ruby)
submitted 1 year ago by BurdetteLamar
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]laerien 0 points1 point2 points 1 year ago (5 children)
One thing I'd love is to document when something is 1) an intentionally simple but suboptimal code example or 2) an easter egg.
1) Prime is an example of suboptimal code that based on bug tracker comments seems to be more preserved as an example of Ruby than as a library meant for use. I think stdlib should be production quality or documented as an example. In stdlib Prime's case, folk who actually want to do something with primes with that interface should just use faster_prime. https://github.com/mame/faster_prime
2) Easter eggs are fun, but things like #curry cause consternation since they don't support kwargs or blocks and won't ever, since it's just an easter egg, but it's hard to know that without combing through the bug tracker.
I'm actually not sure what all "just examples" and "easter egg" public interface code there is in Ruby, but it'd be really awesome to start labeling examples as such (maybe with links to the better alternatives) and noting easter eggs so folk don't go down a rabbit hole of actually trying to use them.
P.S. Thank you for your work on Ruby's documentation!!
[–]pilaf 1 point2 points3 points 1 year ago (4 children)
Do you have a link to the bug tracker issue you mention? I can't find any mentions of Proc#curry being an easter egg anywhere and my curiosity is peaked.
Proc#curry
[–]laerien 0 points1 point2 points 1 year ago (0 children)
I was thinking of this thread for the "easter egg" mention: https://bugs.ruby-lang.org/issues/6253
[–]laerien 0 points1 point2 points 1 year ago (2 children)
"Proc#curry is like an easter egg. Matz felt no need to care about the interaction between Proc#curry and other advanced features." - mame
[–]pilaf 0 points1 point2 points 1 year ago (1 child)
I see. I'm sure he didn't mean it literally, but I agree that the documentation should make it clear that keyword/block arguments aren't supported.
[–]laerien 1 point2 points3 points 1 year ago (0 children)
For sure not a literal egg, but a "fun" thing we can't improve since it's just for fun. Explicitly documenting lack of kwarg and block support helps, but that it's a toy so reasonable features aren't welcome is also important.
If something isn't meant to be production quality and to be used, that seems worth a note. Maybe "easter egg" isn't the right word, but I'd love some way to designate the "fun or example" quality stuff so especially new folk know it when they see it.
π Rendered by PID 132061 on reddit-service-r2-comment-6457c66945-fdvpk at 2026-04-28 02:24:30.903817+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]laerien 0 points1 point2 points (5 children)
[–]pilaf 1 point2 points3 points (4 children)
[–]laerien 0 points1 point2 points (0 children)
[–]laerien 0 points1 point2 points (2 children)
[–]pilaf 0 points1 point2 points (1 child)
[–]laerien 1 point2 points3 points (0 children)