Day 4 in Andela Boot Camp: They Said Everything Is an Object
Well, I had finished the Codecademy Ruby course today. It took me four days; started on Monday (Day 1) and ended today Thursday (Day 4). Quite impressive right; well what is really interesting for me is the fact that I actually completed 50% of the course on Day 4 alone. It just shows that if I had put the same amount of energy and focus I put in on Day 4 earlier on; I could have finished the course in a day. You were expecting me to say two days but it is obvious I could have done it in a day if I had simply doubled Day 4 efforts in a single day. It’s all in our mind.
We were introduced to Object Oriented Programming in Ruby today and one statement that kept repeating itself was ‘Everything is an object’. At first, I was at loss by what this meant but after a while I began to get the picture. I realized that each object had a class behind the scenes. A class being a blueprint that contains code which described how the object will work i.e. the properties (instance variables) and actions (methods) the object will have. So everything you can think of in ruby; a string, an integer, float, array, whatever is an object and are known as the instance of the class. Even a class itself is an object that is an instance of the Class class.
Well, after all the buzz about everything being objects, I decided to find out things that most likely could not be objects in ruby and after printing the result of using the class method on these fellows (can’t call them objects, fellows was the name that came to my mind first); I realized that for comments, control constructs, methods and operators, an error was returned. But I also realized that these fellows do not really need to be manipulated; they are just syntax of the language and not objects. Come to think of it, what should a method you pass to a comment do? Ruby has ensured that the things that actually matter, that you wish to manipulate are objects or can be wrapped around objects (as is the case with blocks and procs or lambda)
Well, I just realized all my last paragraphs apart from the second has started with a ‘well’. Well, I don’t know why exactly but I think the word ‘well’ is an interesting interjection that gives the feel of a conversation. That paused time taken by the writer to ‘imaginary think’ gives written work a more pronounced voice which accentuates the reader’s level of interest. Well, before the ‘well frenzy’, I wanted to add here the game we were introduced to today ‘Zoom Schwartz Profigliano’. I guess no boot camper had played it before. It was really interesting and at the end of it, Sunday and Faith came first and second respectively while I came third. The jovial atmosphere our daily activities imbibe in us helps me personally to take my mind off why my code is not running and focus on the things that really matter; friends, people, laughter and the fellowship.