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.

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.

Frustration Learning Ruby/Rails

I am still going through the Rails Tutorial. I am starting to have some issues with Ruby. It seems like there are methods in files that just float in space and land in your class.

For example, in the tutorial we make a class that inherits from ActiveRecord:: Base. It uses a method called “validates”, that as far as I can tell is part of ActiveModel:: Validations:: ClassMethods. I figured out that the “Methods” frame at the Ruby On Rails site has all the methods for all the classes and modules. Which is good, because the User class does not mention the ClassMethods module. I cannot figure out from the documentation that an ActiveRecord:: Base class can see/use the methods in ActiveModel:: Validations:: ClassMethods.

I posted this on LinkedIn, and I got a couple of responses. One guy’s answer involved looking through the source code, and seeing what classes are visible via the $LOAD_PATH variable. Granted, I posted that I looked through the source code, but I would prefer some way to know what methods are available without diving through the source code. I would like to get the answer via the docs. Another answer said that “the ActiveModel module is part of the ActiveRecord module”. Once again, I cannot find anything in the docs that tells me that. This second person referred me to the “Programming Ruby” book. Perhaps that page has the answer (I will read it later).

Another example is the tests use a method called “have_selector”, which from Googling I conclude is part of the Webrat gem. The test files have “require ‘spec_helper'” in them, and there is a spec/spec_helper.rb file in the project. But none of the test files say anything like “require webrat”.

In Java, every method must be part of your class, inherited from  a parent, or part of a class that you explicitly import. It seems like in Ruby imports can be “chained” (for lack of a better term). Perhaps the spec_helper.rb file starts a chain that at some point refers to a file in the webrat gem. But I would prefer that every file that uses “have_selector” say that it is using webrat, not something that calls webrat somewhere else.

Perhaps I should have gone through a Ruby tutorial before trying a Rails tutorial. Sometimes I like to know something more about a method, but I am sometimes having a hard time finding out where the method is from. Right now I feel like I have to go down a rabbit hole to find something.

Image from Wikipedia, assumed allowed under Fair Use.


Going through Rails Tutorial

I am making some progress with the Rails Tutorial. I installed Ruby with RVM. RVM added one of my accounts to the “rvm” group, but not my main account. So I added that and for the most part things have been good.

I was having some issues installing the heroku gem. I kept getting permissions problems. I am not too clear why, since I was using an account in the “rvm” group. Then after starting another Rails app, I figured out a way: Add “gem ‘heroku’, ‘1.20.1’” to a Gemfile in a project, run “bundle install”, and I got heroku.

An interesting fact: When I used the gem for the first time, I had to enter my heroku password on the command line. I was able to copy and paste a complex password into GNOME Terminal. I did not know it was possible to copy and paste things into a terminal when it prompts for a password. I always assumed you had to type it in. I think I have used terminals where passwords did have to be typed in.

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


Update on Rails Tutorial

I am still going through the Rails 3 Tutorial by Michael Hartl. I am not implementing the examples as I go through it; I am reading it on the CTA as I go to and from work. I will implement them when I am done. I am able to follow most of it. I have done Java programming for several years, and I have also used Grails, so a lot of it was close to something I had done before.

Chapter 4 is a devoted to Ruby. There were a few small things in that chapter that I did not quite get. I have been going to the Chicago Ruby Meetups for a while, and I have not seriously dived into Ruby before this. So far I have been able to follow it. The only thing that I am not always clear on is that I am not always clear whether a class or method is part of Ruby, Rails or RSpec. A lot of times he will say where the classes and methods come from, but I think that if someone has little knowledge of Ruby or the Rails ecosystem it can be a bit confusing.

So far, I think it is a pretty good book.

At the most recent Chicago Ruby Hack Night, I met Obie Fernandez, the founder of HashRocket. He wrote an intro to the book. I asked him to sign my copy.

Image from Wikimedia, assumed allowed under Fair Use. Image from the Vatican Virgil, a 5th century manuscript of poems by Virgil. Note: Some images may contain spoilers.

Ruby Updates

For several months I have been attending the Chicago Ruby meetups. I am now going to get serious about learning Ruby.

At one of the recent meetings a few books were raffled off, and I won one of them: Ruby On Rails 3 Tutorial, by Michael Hartl. I have to review it. I have heard the previous editions were pretty good introductions.

As I have stated on this site in the past, I am transitioning to laptops for my personal use, and I am also running Windows a bit more. This can be an issue with Ruby, since a lot of the API calls only work on Unix OSes.

But I am running Cygwin, so I might be able to get Ruby running on Windows without any issues. I downloaded the source, I ran ./configure –with-out-ext=win32ole, and I commented out the “win32ole” line in ext/Setup.

I ran a few programs that I had problems with on Windows, and so far everything seems to be working.

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