(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:
var x = 2;
var y = 6;
var z = x + y;
/* in 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:
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… ↩