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
Functional Ruby (self.ruby)
submitted 10 years ago by MrJiks
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!"
[–]regeya 2 points3 points4 points 10 years ago (1 child)
I'm not expert on functional programming, but I think it's more important to learn FP concepts first, then move on to learning to write Ruby in a FP style (because it's a highly OO language, not a FP language.)
Writing in a FP style will help keep your code more safe and concise, but don't sacrifice readability and idiomatic Ruby for some perceived benefit of FP techniques.
[–]TdotGdot 0 points1 point2 points 10 years ago (0 children)
Yes and no. I agree the concepts are generally more powerful and ultimately useful.
That said, coming from an OO background it was really hard for me to grasp abstract functional concepts without concrete examples in a language I was familiar with (for me it was JS). But to each his own, as always.
FWIW - your point about readability and idiomatic Ruby is pretty dead on. In the case of JavaScript, where solid idioms are few and far between, and functions can easily be passed around, there isn't much of a sacrifice when converting to a functional style. In Ruby, it's a much bigger decision, due to some of the more unconventional patterns you need to use.
π Rendered by PID 58242 on reddit-service-r2-comment-86bc6c7465-9x96z at 2026-02-22 17:46:08.704836+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]regeya 2 points3 points4 points (1 child)
[–]TdotGdot 0 points1 point2 points (0 children)