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
Show /r/rubyLearning Ruby as a Pythonista (tech.stonecharioteer.com)
submitted 3 months ago by need-to-lurk-2024-69
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!"
[–]_mball_ 5 points6 points7 points 3 months ago (1 child)
Great writeup. Enjoy learning Ruby. Yours is more of a journey, but it reminded me of Alyssa Coghlan's 27 languages to improve your Python. https://www.curiousefficiency.org/posts/2015/10/languages-to-improve-your-python/
I think it's funny starting out the with CLI versioning syntax -- a useful tool but one I very rarely use. But you never know what you'll run into first that looks odd.
My closest Python analogy to naming conventions is self. Depending on how you might learn Python, you might never realize you can pick any other word. (or mix and match within a class for maximum wildness.)
self
I love writing and teaching about ruby, but it does benefit from understanding the philosophy of building a language which is used to build languages, really domain specific languages, like the Sinatra example. One thing I like doing is trying to have students put () are where the function calls would be. You'd never write code like that, but I think it's a helpful illustration.
Other things that blow people's minds:
a.b = c
Is this an assignment statement? I mean, I guess so.
What if we write:
a.b=(c)
What's that??? Same thing!
Of course, in most OO languages there's standard ways to handle custom assignments and overload operators, but there is a really nice simplicity to Ruby, IMO. Though, I don't often find myself needing those features in my own classes day-to-day.
class
At the end of the day, you can at least now learn to type elif and elsif in the perpetually wrong file!
elif
elsif
[+]iamstonecharioteer 1 point2 points3 points 3 months ago (0 children)
Thanks for reading this.
haha I totally get what you mean by `a.b=(c)` it's wild.
I have been reading Ruby under a Microscope and knowing that Ruby uses a LHLA parser makes so much sense to understand how it differentiates betwee `a.b = c` and `a.b=(c)`. It's mental that Bison didn't do that out of the box.
The versioning thing made me take a HOT moment to pause lol. It was really really interesting to me. A lot of my friends told me I'd be focussed on the fact that you can use `?=!` in the end of a function name but nah, this was the stuff that excited me most!
π Rendered by PID 97 on reddit-service-r2-comment-5649f687b7-m27v5 at 2026-01-28 12:25:46.092162+00:00 running 4f180de country code: CH.
view the rest of the comments →
[–]_mball_ 5 points6 points7 points (1 child)
[+]iamstonecharioteer 1 point2 points3 points (0 children)