(Yesterday, I learned the basics of Ruby.)
I’m not falling behind with my lessons. It’s more of me falling behind with blogging about my lessons. 😅
So, for that one day, we learned about the familiar programming basics: objects, strings, integers, booleans, nil, 1 variables, methods, arrays, hashes, the most basic of all the basic concepts in programming.
Here is a quick sample:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// in Javascript... var x = 2; var y = 6; var z = x + y; /* in PHP... */ <?php $x = 2; $y = 6; echo $x + $y; ?> # in Ruby... x = 2 y = 6 z = x + y |
As you can see with variables, Ruby is plain and straightforward, like it’s an algebra equation. It doesn’t reply on many special characters like the semicolon, but there are a few instances where special characters are required, especially with certain methods that have two or more instances. We were given worksheet guides to the most common methods used in Ruby, and that we were given some time to “talk” to our computers by using Ruby.
Here’s a screenshot of what I did in one of my challenges:
I still have to read the provided documentation that the instructor gave us, however, I think I’m finally getting the glimpse of the basics. Ruby seems to be a lot easier to remember than Javascript and PHP because it didn’t have like Javascript’s var
or the PHP’s $
.
There are no classes on weekends, but they do provide us with some interesting tidbits and reads related to Ruby, and of course, gave us more worksheets, guides, and documents to our hands so we can practice some more.
Awesome links you can check out if you’re curious about Ruby:
And that’s about it! Will write again in two days!
On the sidenote…
- as in nothing, nada, zilch… ↩