JCGuest.github.io


Ruby Episode II: The SQL

At first glance, SQL can appear to be a little unwieldy and unfriendly. That was my first reaction anyway. SQL (Structured Query Language) is a query language that is used to manage databases and perform various operations on the data in them. The language was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. Edgar Codd invented the concept of the relational database and came up with the idea of storing data in tables, indexed by primary key and related by foreign keys to ‘normalize’ the data. The goal of data normalization is to reduce redundancy. SQL does this beautifully.


My First Ruby Gem

It’s exciting that I can now say I have designed and published a Ruby gem. It scrapes from live websites and interacts with the user using the command-line interface. It first prompts the user to select from two news websites. Once a source is chosen it prints headlines from those news source’s websites. I added a second level as well so the user can select a headline and get the URL link for their chosen headline. The basic structure of my gem was built using an amazing feature of Ruby called bundle gem: bundle gem "gem name".


What is Object Oriented Programming (OOP)

In OOP, we indentify objects for our programs to use. Humans think about objects as things with attributes and behaviours and use these objects based on those attributes and behaviours. In Ruby, these objects become classes, the blueprints and factories for objects. Each instance of an object contains instance variables which are the attributes of the object and the behaviours are described via methods. Take the example of a dog. A dog is a can be seen as an object which can be realized in Ruby as a class “Dog”. A speciffic breed is an attribute of the Dog class. The attributes of a breed such as size and color can be stored as instance variables. If you want your dog class to bark, this is a behaviour which is described by a method.


Learning How To Learn

I have always had a natural curiosity about the world around me. I am enamored with the complexity of everything and how it all seems to perfectly work together. Even when I was child I remember pestering my parents with endless questions as mundane as “how does the dishwasher work?” to questions like “how old is the universe?”. Despite all of this; school always seemed to somehow take all of the magic and beauty out of learning for me. Well, except for science class. Science class was a place of happiness and, for me, it was the only place on the entire campus where I felt as though my curiosity was fully quenched. God bless science class and god bless science teachers. My science teachers were always so filled to the brim with a shining and bright-eyed wonderment that I think all educators should have.

One of the primary ways we are taught to learn in grade school is to memorize a bunch of information and then take tests on how well we memorized it. Other than the minute amount of details that one might retain after this repetitive process; the only thing that is learned this way is how to mindlessly repeat information. For one to learn programming this method of learning is all but useless. If you were to take the “grade school” style approach to the world of coding you would have only one small part of what it takes. Memorizing every syntax and every little operator and method of every language would be useful. However, in the world of programming languages, the languages themselves are trends. What is trending now may be useless in the next five years. So the most important skill in programming is not to know the most but it is to ask the best questions.