Code Academy Notes Week 1

Here are my notes from Code Academy week 1.

Almost everything is lower-case
Methods: def method_name to name

Lists in Ruby
Very important to be good with lists.

This is an array. You do not specify the size.
Iterate through array:

irb is “Interactive Ruby”
for a variable or a class, you can type “x.methods” in irb to get all the methods you can call on it
to print them alphabetically, x.methods.sort
to get out of irb, type “exit”
An array is a list of single elements
A list of pairs is a hash:

Braces instead of brackets
Iterate through hash:

Any methods created in a variable are local to the method. They only have meaning within the method


Back to Ruby: String interpolation, use the pound and braces:

Interpolation is a bit faster

To set the variable, single equal sign:

To compare the variable, double equal sign:

Ruby classes:

give it a symbol (colon and some name)

Variables: @name, @address, @cost: Private variables to that object
attr_reader will allow you to set it only at initialization, and only read thereafter
You could make a variable @api_key to be private, just don’t provide an attr_accessor
In pure Ruby, there is no way to ensure that @cost is always greater than 0. I would have to write my own methods for that.

Image from Wikimedia, assumed allowed under Fair Use. Image from the Vatican Virgil, a 5th century manuscript of poems by Virgil.

Code Academy Week 2

I have been through my second week at Code Academy.

We started using Rails and some of the Rails commands. So far it seems pretty nice. It is a lot easier than the Java frameworks I have worked with.

I went to a lecture on  HTML5/CSS by Shay Howe. I may not make to every one, put I plan on going to as many of these as I can. I also went to a lecture on the Lean Startup idea.

I went to the Chicago Ruby hack night. The problem was Scrabble. I got the first step of it done. I should rewrite it with rspec. I was not writing tests first. I also am having trouble remembering how to iterate over collections in Ruby.

On Friday I went to the 8th Light University lecture. It was on cryptography. I also met with my mentor. We went over rspec and cucumber. My brain was overloaded after a couple of hours. I got the concepts, but he threw a lot of details at me. Another Code Academy person was there as well. He owes me an hour with his mentor.

I also spoke with Colin Jones, who is working on a project to improve the repl in Clojure.

Image from Code Academy, assumed allowed under Fair Use.

First Week At Code Academy

Here is my late blog post about my first week at Code Academy.

First off, getting up that early is pretty tough. I am trying to become a morning person. So far I am doing okay.

We use pair programming in class, and so far I have had a different partner each time. My partner on Thursday knew little about programming. A couple of things mentioned in class were brand new to him. I tried to explain a few things to him, but I think I may have made him more confused.

I also read one of the recommended books: Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman by Dave Hoover and Adewale Oshineye. It is available online for free. I do not know who Adewale Oshineye is. He is in London now, so I will probably never meet him. However, I have met the other author: Dave Hoover is a lead developer at Groupon here in Chicago. He was a lead developer at a consulting firm here in Chicago called Obtiva which was bought by Groupon. He runs the weekly Geekfest at Groupon (which I might not get to for a while since I am in the Tuesday-Thursday class). He is also a mentor at Code Academy.

The book is full of techniques and strategies for people who are getting into software, as well as people like me who are going from one language to another. I think it was intended for people coming into software, but the patterns apply for all software developers. I read through it in a few sittings in a couple of days. It was probably intended to be read slowly, but a lot of stuff will be thrown at us in Code Academy, so I wanted to get through it. Plus I can always re-read it. It has advice that I think will still be good as long as there is software. Until the moon turns red and the screens turn blue.

It helped shed some light on the software craftsmanship movement as well. I have been seeing people referring to themselves in blogs and profiles as software craftsman and I have seen references to apprentices and apprenticeships. It turns out this movement started about ten years ago and has been gaining momentum ever since. I only became aware of it a little over a year ago. I guess that is what happens when you work for a large multinational.

The only beef is that some of the links are out of date. I got a few “Page Not Found” messages for a few of them.

One neat thing is that I have met quite a few people mentioned and quoted in this book, including Dave Hoover.

Image from Code Academy, assumed allowed under Fair Use.

2012-01-11 Update

I have decided to learn other technologies during my job search. I applied to Code Academy here in Chicago. It is a 12-week program that teaches Ruby on Rails and entrepreneurship. I am also interested in Clojure and Android, but I decided that I needed to sign up for some training to give myself some focus.

The only Clojure training that I could find was only a week. I did not look for Android training. Code Academy is three months, and a lot of people in the Chicago technology and startup communities are involved to provide mentors, equipment and advice. I think that getting training of longer duration will be better because there is more time to absorb the material. Plus there are a LOT of people involved. I will still be jumping off a cliff at the end, but I think that the chance of success is a lot higher.

The current class is the second class to go through.

The original intent was to teach web technologies to entrepreneurs since a lot of startups fail since most founders do not know technology and do not always communicate well with their developers. Plus a lot of developers do not know much about being on the other side of the desk. I plan on staying a software developer, but I would like to know more about what makes founders, investors and VCs tick. A few people have suggested that I go freelance, but then I would have to deal with sales, and paperwork, and all the things that software developers do not like. What is the difference between an S-Corporation and an LLC? These will be covered in addition to Ruby on Rails.

There were also some people in the first class who were software developers who wanted to transition to Ruby on Rails. After speaking to a couple of them, I decided to apply. When I had the interview I also spoke to another developer transitioning to Ruby on Rails.

I will still be posting about Java. I am finally getting around to some posts about things that I have been thinking about for a while.

Lastly, to use some pseudo-Java notation,  “Code Academy” != “CodeCademy“.

Image from Code Academy, assumed allowed under Fair Use.