How well do you really understand Ruby methods?
Let's find out. (1/100)
Let's find out. (1/100)
Comments
Ruby is indeed a "classical" object-oriented language. But this is just an *implementation detail* of the language.
The real fundamental building block in Ruby is in fact, not the
From time to time I'll ask you to think about something or answer a question for yourself as you read.
You'll get much more out of this thread if you jot a few things down. It'll help you "think out loud" as we go.
(3/100)
EXERCISE #1:
<< Without looking up a definition, take 30 seconds right now to write down what a Ruby method is, in your own words. >>
Don't overthink or overanalyze, just whatever explanation immediately pops into mind.
Wait until you've done that to read on.
(4/100)
My best guess is, we may have defined things differently already! No worries if so, in fact, that's kind of the point.
(5/100)
Yes, there are many nuanced details to that concept as well, but the basic mental model is more-or-less:
"A function takes inputs, runs some computations, and then returns a useful result as a value"
(6/100)
We can define methods that *act like* functions, but that's purely conventional with no language-level constraints.
So if your mental model of a method is that it's pretty much just a function, then you need to expand it... a lot.
(7/100)
https://bsky.app/profile/skillstopractice.com/post/3ldt6ci44oc2u
Curious to see what your thoughts are as you read on!
Don't be afraid to share thoughts, either in the thread or over DM... It's a fun way to explore learning together out in the open.
But just reading is fine as well, and there's plenty more to come. :)