I finished “Learn to Program”

So as the title states. I finished “Learn to Program” by Chris Pine and I will write a view on the book some time in the near future. For now I’ll give you an idea of what kind of site I’m going to build in order to push and challenge myself.

Name: Rooster
Details: Rooster is a roster site designed for RTS, MMO, Shooters, and really any game that has a group of players that get together and associate themselves under a common alias. The name isn’t concrete, but the idea is.

  • The site will have a home page with a sign in/up and a navigation that will have a list of game types(MMO, RTS, etc.) once clicked you will see a list of games within that type
  • once a specific game is clicked all clans within that game will show. On all the types, games, and clans you will be able to view a forum.
  • Within each clan page you will be able to see the roster.
  • If you are a member of a clan page you will be able to edit your profile, view the roster, view a home page feed, and clan rules and responsibilities.
  • As an admin you will be able to edit what fields will be displayed within your roster, edit the fields within your roster, edit individual profile pages, post new feeds on main clan page, edit or delete old ones. edit rules and responsibility page.

I’m sure this is an odd way of explaining the use of my site. I hope you get the point. If you don’t get the point, you will most certainly understand it after I’ve completed the site. Check out my progress at github.

Thanks to those of you that have viewed my blog and started following me. If anyone has any questions for me I’m always happy to try to help. I’m no expert but I firmly believe that a person cannot improve his/her skills without crossing that line of comfort.


Learn to Program Example by Chris Pine

Here is a program I through together this morning. The only thing I haven’t gotten working is validating the month can be value.dowcase or value.upcase or value.capitalize


mo = {1 => “Jan”, 2 => “Feb”, 3 => “Mar”, 4 => “Apr”, 5 => “May”, 6 => “Jun”,

7 => “Jul”, 8 => “Aug”, 9 => “Sep”, 10 => “Oct”, 11 => “Nov”, 12 => “Dec”}

def ask string
  puts ‘What ‘ + string + ‘ were you born?’

ask “year”
year = gets.chomp
while (year.to_i > Time.now.year) || (year.to_i < Time.at(1875).year )
  puts ‘Please enter a 4 digit year between 1875 and ‘ + Time.now.year.to_s
  year = gets.chomp

 # need to get month working so that value, value.downcase, and value.upcase are working

ask “month”
month = gets.chomp
while (month.to_i<1) or (month.to_i > 12)
  puts ‘Please enter a month between 1 and 12’
  month = gets.chomp

ask “day”
day = gets.chomp
while (day.to_i < 1) or (day.to_i > 31)
  puts ‘Please enter a day of the month’
  day = gets.chomp

def spank (year, month, day)
  birthday = Time.local(year, month, day)
  years_old = (Time.now – birthday) / 3600 / 24 / 365.25
  puts ‘You get ‘ + years_old.floor.to_s + ‘ spankings!!!’
  puts “SPANK!!!\n” * years_old.floor

spank year, month, day

From Rails to Ruby

So I got through the first 2 sections of ‘Agile Web Development with Rails’, you can see my progress on Github at www.github.com/dannysperry. I started reading ‘Learn to Program’ by Chris Pine. A couple years back I got this book and went through the first 90 or so pages in a day or two, then I got to a point where they want you to build your own sorting method for arrays as opposed to using the simple array.sort

View my code at pastie.org

It took me a little bit to find it, I searched all through Ruby-doc.org and couldn’t find anything that would let me find the least value’d or most valued object inside an array. I searched just that and found the .min and .max feature which just made it all come together so easily after that.

This ruby book is relatively easy, the examples just take a problem solving mind that can wrap around the issue and a little bit of research through the documentation. I’m sure that .min is somewhere in the documentation, I just didn’t see it there. Last time I read ‘Learn to Program’ I got stuck and gave up. This time around I’m pushing through all things that seem difficult. No rails, ruby, javascript, jquery, or git are going to conquer me, maybe for a little bit, but in the end I will figure it out.

My path to learning web development

Learned bad HTML and CSS in 2006 thanks to Myspace

Learned better HTML and CSS in 2007 thanks to CSS Mastery and a html book that explained using tables is bad.

Was introduced to Javascript in 2008 and got overwhelmed.

Learned the 320+ boilerplate and custom responsive designing as well as other CSS3 and HTML5 in 2009 or 2010(can’t remember).

Studied jQuery with sitepoint’s “jQuery Novice to Ninja” in early 2010.

Got a couple Ruby and Ruby on Rails book in 2011 and got introduced to both ruby and the rails framework. Why’s poignant guide to Ruby was a excellent/silly introduction to the language.

Went back to jQuery and css3 and built a very small css3 nav and jquery slider mid 2012.

The Pragmatic Programmers “Learn to Program” by Chris Pine and “Agile Web Development with Rails” by Sam Ruby, Dave Thomas, and David Heinemeier have been my current reads as of early 2013. I’ve worked through approximately the first 250 pages of Agile web dev with rails and I’m going to read Learn to Program to brush up further on the ruby side of it. I’ll then finish Agile web dev with rails to get a full understanding of the rails framework and continue on to attempt to read all of “The Pickaxe”(prob version 3)