Skip to main content

Posts

10 week update

    With the exception of the week over Christmas, I have been studying coding for every week for 10 weeks now. I estimate that I have spent 300 hours on study so far. Realistically, not all of that time was spend coding, much of it was spent reading forums looking for help, watching lectures, reading books as well as brushing up on mathematics. So, perhaps half of the time (150 hours) could truly be called coding practice.    Without a mentor, it hasn't always been easy deciding on the path to take. I spent the first 2 weeks on Java, as that was the first course I found. Then I discovered The Odin Project and spent the last 7 weeks learning Ruby, Javascript and SQL. Over the last couple of weeks I started some Python study, including an online course.  Just before Christmas I also discovered FreeCodeCamp which focuses on Javascript.  I believe that I've finally discovered the best path. Last week I volunteered as a mentor at my first CoderDojo. Last n...

Reasons for Retraining

10 weeks ago, after looking over the many possibilities open to me, I decided to retrain myself as a programmer. I made the decision due to a number of factors. They are not listed in any kind of order. The availability of free online materials teaching programming. The fact that programmers are unlikely to suffer deskilling. (Every week a biochemist spends outside the lab, is a week they are not practising their lab skills. A programmer can continually learn and practise from home.) The fact that, over the years, I have become more interested in and adept with mathematics. (If I could redo my degree now, I would choose Computer Science or Physics). Creating things (even abstract things like programs) is incredibly rewarding. Not only is there the intellectual satisfaction, there is the sense of accomplishment when your program executes correctly. The wide availability of jobs in software & web development  These were the reasons I made th...

Venturing into Number Theory

In attempt to solve a maths problem with Ruby, I discovered the benefits of going beyond simple arithmetic. Perhaps surprisingly, many seemingly complex mathematical problems can be solved using basic arithmetic and raw computing power. Most of the time this doesn't pose a problem. However, as the values involved grow larger, the demands on the computer's memory reaches a critical point beyond which you risk crashing your computer.  The problem I was trying to solve was the following:    What is the smallest positive number that is evenly divisible  by all of the numbers from 1 to 20? After causing my computer to hang for several minutes, I realized I had to rewrite the program I was working on. The program had to take shortcuts, so that instead of testing every single value between 1 and 1 million, it only tested likely values. With the help of my lovely wife (a Maths teacher) I rewrote the program using prime numbers.   class SmallestProduct requ...

Einstein's Logic Puzzle (SPOILER ALERT!)

On Monday I began working through a Discrete Math textbook in preparation for some courses I'll be taking in January. There was a beautiful logic problem in Chapter 1, apparently created by Einstein. This is one version of it: Five men with  different nationalities and with different jobs live in  con secutive houses on a street. These houses are painted  dif ferent colors. The men have different pets and have   dif ferent favorite drinks.  Determine who owns a zebra and  whose favorite drink is mineral water (which is one of the  favorite drinks) given these clues:  The Englishman lives  in the red house.  The Spaniard owns a dog.  The Japanese  man is a painter.  The Italian drinks tea.  The Norwegian  lives in the first house on the left.  The green house is  immediately to the right of the white one. The photogra pher  breeds snails.  The diplomat lives in the yellow house. ...

Object Oriented Design- Wading into Deeper Waters

Objects, classes, inheritance, polymorphism- it sounds a little like Biology, and in some ways, object oriented programming (OOP) mirrors the natural world.  I've finally reached the OOP section in the Odin Project's Ruby Programming course. Many of the concepts are straightforward-especially to anyone who has read a little philosophy or studied evolutionary biology. The difficult part is translating the concepts into actual functioning OOP applications.  I've started reading what looks to be a promising book on OOP design in Ruby. I've learned something already that may improve my code. Here's an example from chapter 2:  class Gear    attr_reader :chainring, :cog,     def initialize(chainring, cog)      @chainring = chainring      @cog = cog    end    def ratio      (chainring / cog.to_f).round(2)    end end This is the 'good' way to create a class....

Programming vs Learning to Program

This is a multi-faceted topic, I want to look at one aspect in this post: effort vs. efficiency. After creating a Caesar cipher in Ruby  a few days ago, I looked at some other student's solutions. Some students were clearly experienced programmers- their code was 5 lines of densely packed recursive algorithms.  At first I was discouraged and thought "What can't I do that ?", and "Why doesn't my code look that ?".  Then I reconsidered. My solution to the Caesar Cipher represents my  single handed efforts at solving a problem. The solution was based on the 4 weeks of experience I have with Ruby.  Sure, there are built in methods that would have accomplished the task more elegantly (like the .modulo method).  Sure, I could refactor my code making it shorter and making it run faster. But, until I learn those methods and refactoring techniques, using them because someone else told me to would short circuit my learning. When I do search on StackExcha...

7th Week-Progress

I have entered the 7th week since my fatal decision to become a master coder. What progress can I report?    I finished The Odin Project's Web Development 101 course on Monday and began the third course in curriculum : "Ruby Programming". Although I completed the Codecademy Ruby course and did some other Ruby work a few weeks ago, I felt I needed a review.  To this end I am redoing the Codecademy course, I completed Chris Pine's book  Learn to Program,  and I reread Chs.2 + 3 of Peter Cooper's Beginning Ruby .  Needless to say, the revision was worth it- I have a much clearer understanding of blocks and procs, as well as hashes and arrays. Concurrent with the Odin Project I am working through the  Epicodus curriculum . It is always helpful to have multiple perspectives on a subject. I have also discovered an intriguing course called FreeCodeCamp . It isn't complete yet, but the aim is to train students to write code for non-profits. Much of t...