This week I read two more chapters of Sadi Mertz’s  book .  The concept of inheritance at its surface is straightforward- a mechanism that delegates the transmission of messages among classes.  You have a superclass that communicates with its subclasses but each one of these subclasses can only communicate with the superclass.

Think of a raw turkey meat as a  superclass. From this superclass you can create subclasses with suggestive and yummy names such as baked turkey, grilled turkey, fried turkey, and the like (As of the time of this writing, it is the post Thanksgiving weekend so naturally I am eating a good amount of left over turkey).
Continue reading “Inheritance”

On Banging

Methods that end with a “bang” in Ruby are arcane.  These are the ones which require a “!” (exclamation mark) at the end of a method.

Consider the example below.

string = "example"
string.capitalize #=> "Example"
string #=> "example"
string.capitalize! #=> "Example"
string #=> "Example"

view raw
hosted with ❤ by GitHub

“!” after .capitalize modifies the object for good.  The string “Example” will be always capitalized in your program whenever you call the variable string.  Easy to understand right? I thought so too until I started bagging anything under the sun that needed changing.
Continue reading “On Banging”

I Am a Deaf Frog

“Nothing is unattainable. Something can be very difficult to achieve, but not outright impossible. With time and determination, I will get it.”

I say this to myself every time I  am confronted with adversity. This past week was the second week of the Web Development Fellowship. The level of complexity of the exercises are increasing by the day and what took me a few minutes to finish is now taking me hours. When I am working on hours on a program problem, and I still can’t see the end of the tunnel, frustration sets in. Whenever I am frustrated and my mind tricks me into quitting,  I remember of my young self in acting class.
Continue reading “I Am a Deaf Frog”

Singly Responsible

For homework, I read last night the chapter on the Single Responsibility Principle (SRP) from Sandi Metz’s book “Practical Object-Oriented Design in Ruby“.

SRP is the idea that a class should have only one responsibility because they are easy to change and therefore easy to reuse.

If you are a visual person, the picture below will give you an idea:

Single responsibility picture

Continue reading “Singly Responsible”

FizzBuzz 2

I want to compare now my Ruby FizzBuzz code with two others I found on the web.

This is mine:

101.times do | i |
if i % 3 == 0 && i % 5 == 0
puts "fizzbuzz"
elsif i % 3 == 0
puts "fizz"
elsif i % 5 == 0
puts "buzz"
puts i

view raw
hosted with ❤ by GitHub

Not bad, not bad.

I was curious to see what other solutions was possible with Ruby. So I decided to research in the series of tubes.
Continue reading “FizzBuzz 2”

Shortcutting in the Terminal

Blake, one of instructors at Flatiron School, gave today an informative lecture on dev tools and environments – irb for Ruby, Homebrew, X code command line– among other good stuff. He also gave handy tips about installing (and debugging in case it happens when installing) the aforementioned bag of tech goodies.

The part I most enjoyed about the lecture today was the keyboard shortcuts used in terminal. He scolded me a couple of times for using the mouse touch pad instead of ” alt + tab ” for changing the operating system open windows.  I learned from him after this baptism by fire (I kid of course, Blake is great)  that there are lot of useful commands that allow you  to navigate the terminal without ever using the mouse again if you so desire.   After researching more about this topic and practicing some commands I mastered a few commands today. Here they are:
Continue reading “Shortcutting in the Terminal”

Opt- imism

Optimism defines your success. I am about to start an educational journey today. For the next five months I will working with 28 peers with the same level of computer programming that I do – almost nothing . We will learn and grow together. It will be brilliant and glorious. But it won’t happen well if we don’t cultivate a sense of optimism about our learning.
Continue reading “Opt- imism”

Last Day of Pre-Work

It has been three and a half weeks of learning through videos, blog reading, and quizzes. The pre-work prepared to students by the Flatiron school aims to give students exposure and basic understanding of some the concepts and  programming languages that are going taught during the semester. The pace is going to be quick tell Ashley and Blake, our instructors, and it will help for all to be comfortable with the fundamentals.
Continue reading “Last Day of Pre-Work”