How to Get a Job as a Developer in Less Than Six Months

So the month of June came and went, and so did July. A lot has happened, but I wasn’t able to complete my goals

I did, however, make huge strides in my programming skills – so huge, in fact, that I was hired as a junior developer at Medivo!

This post is about how I got hired for my dream job with less then six months of programming experience.

Learning to Program

Work your ass off:

This isn’t how to fake your way into a position. It is how I got real results in a short amount of time.

I was, however, in a unique position. I didn’t have a job, I was only taking one class and I had fallen in love with programming.

So, in order to make the kind of strides I made, expect to spend at least 10 hours a day, six days a week dedicated to programming activities.

Read a shit ton:

The Pragmatic Programmers is now your best friend. If you are learning Ruby, get the Ruby 1.9 manual, Learn to Program, and get their Pragmatic studios learning ruby course (It is $200 but worth every cent). Start with the Pragmatic studios video course, and after about five lessons, start step two of my process while continuing to work on the videos.

Join your local ruby group:

This is a must. If you ignore everything else I say, still join your local meetup group.

This is imperative for three main reasons: First, the people you meet may become your employers, or they might introduce you to your future employers. Second, you will be around the people that have the jobs you want. Listen to them, jot down notes about the things they say, and if you don’t understand, then go research it. Last, if you show passion, you will likely find enthusiastic mentors from this group of people. I would not have made it as far as I have without Gavin Stark, Aubrey Goodman and the rest of the Tampa ruby brigade.

Write a ton of code:

Learn git and get a GitHub account. Push code to github EVERYDAY. There is no exception to this rule.

There are no shortcuts, you must write code, and a lot of it. It doesn’t have to be good code, but you must write it. If you look at it and think, “boy, this is shitty,” document the code and explain what you were thinking.

Make everything public:

This is an important aspect of writing a ton of code. If you keep it to yourself, it can be as shitty as you want. I find that if its public, every line of code has to be defendable, even if your reasoning is flawed. It is easier to adjust how you do things if you know why you did it in the first place.

Get a GitHub account, learn git like a boss, make every repo public.

Blog about your challenges:

You will face challenges just like everyone else. Blog about them incessantly. You can’t get any better unless you are asking for help. Also, having a record of your progress will come into handy later when you are trying to get that job.

Make sure you also blog about your successes. When you get something right, especially early on, it feels like the most epic of wins. Tell everyone about how awesome it feels and how you did it.

Getting The Job

So now you know a little programming. Don’t wait to get to a point where you feel skilled enough to get a job, because you will be waiting a long time. There is a desperate need for developers, and you are doing a great disservice to yourself and to the community. By learning on the job, you will give yourself a much more focused learning environment. However, here are a few things that will make the search go a little smoother.

Learn to speak like a programmer:

You’ll get a little of this from your reading and from your meetup groups, but there is more you can do. First, listen to related podcasts, I recommend every episode of Ruby Rogues, next subscribe to Rails Casts and Destroy all Software two great programming screen casts.

Some of what is discussed will go right over your head. That is okay. The point of this is to learn how developers speak. When you interview this will be an important skill.

Cast a wide net:

I got my job by sending out this email to the NYC Ruby community:

Hey NYC.rb!

I am a (relatively new) self-taught programmer moving to NYC from Tampa, FL at the end of July. Tampa’s awesome Ruby community inspired me to learn Ruby as my first language, and I’m excited to get involved with the New York City Ruby community.

I am graduating in a few weeks with a degree in business and entrepreneurship from the University of South Florida but found my passion, programming, while I was hiring a developer for one of my businesses.

I am looking for an internship/apprenticeship/junior programming position open in the area. If anyone has or knows of such a position, I would love to meet in June when I am in town for GoRuCo.

I am getting fairly proficient with Ruby, know the basics of JavaScript, HTML and CSS and am currently working with Rails. I learn quickly and work hard.

You can see where I am with my skills on GitHub, and I blog about my learning at learnwithjeff.com. Any feedback or advice is greatly appreciated!

I look forward to meeting some of you and getting involved with the New York City Ruby Community.

Sincerely, Jeff

I got 40+ responses in 18 hours. I also found every NYC ruby shop I could and read about them.

Next, I made a list of my top 10 companies and I worked my ass off to get interviews with all of them. I also stayed open to a few more pending discussions with the people on the team.

Don’t underestimate your value:

When I started this search I thought I would be scrubbing toilets in exchange for nightly code reviews. While that determination was probably a good thing, the market is currently in favor of devs looking for work. You may be a n00b, but don’t underestimate your value.

So to sum up:

Work hard, write a lot of code, be transparent and be enthusiastic.

In February 2012 I had never written a line of code. But, as of July 11, 2012 I am employed as a full-time Ruby Developer. You can do it too :).

Goals for the Month of June.

In my learning, I find it immensely helpful to set lofty (but possible and measurable) goals. I didn’t my goal for the month of May but it was pretty straight-forward, publish a gem. I accomplished that goal, twice. I’ve decided to talk about my goals out for the month of June since they are much more challenging than my goals for May. First, I want to publish a “useful” gem/plugin/program/app. Second, I want to make some contribution to an open source project. Both of these are a little subjective, so let me define further. I define “useful” as someone other than myself uses it. Not just downloads it, actually uses my creation. Now, since I can’t control whether or not my contribution to an open source project is accepted, I will be a little more loose in that definition. I want to issue a meaningful pull request on a public repo that has multiple contributors. I realize that the above are huge challenges for a beginning programmer, but I wouldn’t get anywhere if I only tried to do comfortable things :)

Testing - a N00b’s Reflection

I have officially spent more time testing and refactoring my code for my black jack game, RubyJack, than I have on the original code base and it has taught me a big lesson: TEST FIRST.

This is a topic that I don’t have the breadth of knowledge to really attack. Jeff Atwood does a much better job than I, here. I do, however, feel that I can add the perspective of a new programmer.

The challenge of testing first as a n00b, is that when you are learning to program, you generally learn

    def print_hello_world


      puts "hello world"

    end

    print_hello_world

before you learn

    it  "prints hello word" do

      print_hello_world.should == "hello world"

    end

I wouldn’t say this is a mistake since testing is inherently more complicated, but it does create a significant barrier to entry to the new programmer. This barrier is mainly a comfort level thing.

When I was first learning about testing, I thought “I can really see the theoretical application of this, but my programs are so simple now that I don’t need tests.”

BIG F&%$ING MISTAKE.

The big example, in RubyJack, of where writing my tests first would have helped me, was during the refactoring process. The first draft of my code may not have been bad for a new programmer, but was(is) poorly written software on a whole. There were methods in classes where they didn’t make sense, arrays of strings where they should have been arrays of objects, 25 line methods that did one simple task and many, many other problems.

Up to this point my tests consisted on running the program through my command line, playing the game till it broke and reading the error message. Not super efficient.

So, after I published the first version of the gem (gem install RubyJack) I started to move stuff around. First, I did some simple refactoring of individual methods, no problems. Then I thought “oh, well this method that starts the game probably should be in the ‘Game class’ and not the ‘Player class.’”

All Hell Broke Loose.

Nothing worked anymore, I couldn’t even start the game let alone deal a card or initialize a deck.

Thank god for “git reset –hard”.

I was able to hop back to my latest commit and start again (more about using commits to your advantage later). Then, I wrote some tests. It was hard;  it hurt my head; I didn’t like it.

I struggled through them and got (most of) them to pass. Around this time I brought in some professional help, Gavin. Gavin was nice enough to sit with me and help me do a little (a lot) of refactoring of my code. We moved some methods into classes where they made more sense, and created classes that should have been there from the beginning.

Then I tried to do some more refactoring on my own, which led to even more problems. I hadn’t learned my lesson.

Once again, I found myself reaching for “git reset”

It was then that I resolved to write better tests. I re-watched the pragmatic studios video on unit testing and peppered Gavin with some more questions. Then, I wrote a bunch of tests and MADE THEM ALL PASS.

When I originally wrote my tests, if I couldn’t get a test of a certain functionality to pass, I marked it as “pending” instead of figuring out the problem. Not this time. It took me hours, and until 2am, but I made them all pass.

I then entered the process to which Gavin introduced me to:

Red

Green

Refactor

What that translates to is this:

Check my tests, if they pass I make one small change. I then check my tests again, some of them may be failing, I want to make sure they are the ones I expect. Then, I continue tweaking the code till I get it to pass all the tests again (sometimes tweaking the tests too).

Then I start the process all over again with my next change.

The benefit to testing first, as I see it, is as it concerns the thought process towards your code. As J. Timothy King States:

You ask, “What code will I write to generate a solution?” But that’s backward. The first thing you should be doing… The first thing you ask is not“What code will I write?” The first thing you ask is “How will I know that I’ve solved the problem?”

So, my tip for other n00bs out there is to learn to test sooner rather than later. You won’t regret it.

Thank You!

I want to give a huge public thank you to Gavin Stark for helping me with the refactoring process and answering all my crazy n00b questions. Thanks Gavin! Also, thanks to Aubrey Goodman who graciously takes my questions at all hours. Finally, I’d like to say thanks to Andy Lindeman who went through and commented on my code on github! It is people like you guys that make the Ruby community awesome and make me glad to be a part of it.

Disclaimer, links, and tweets

I love to learn and I do not pretend to be an expert on the topics I post about. If I’m wrong please, let me know in the comments, I love feedback and you won’t offend me. Follow me on Twitter; I love to discuss Ruby, books and anything interesting.

If you want to help an aspiring Rubyist, I’m on GitHub and would love any feedback you have to offer.

Many people have helped me learn, I would love to return the favor! Get in touch and I’ll see if I can help.

Thanks for reading!

RubyJack My Second Ruby Gem!

For the last two days I have been slaving over my second attempt at a real ruby program, this one with no help from my friends over at pragmatic programming. I am going to briefly go over something I learned doing this, some of the problems I faced and some of the features I am still working on.

If you want to find the project I am working on, the source code can be found here on my GitHub profile.

You can install the gem with $gem install RubyJack

TIL:

Today I learned a little bit about ruby’s regular expressions. I  know there is a lot more that I don’t know about them, but from what I can tell, they are powerful. The most basic definition I could find of a regular expression is from the Programming Ruby 1.9 book (the latest PickAxe addition):

A regular expression is a pattern that can be matched against a string. It can be a simple pattern, such as the string must contain the sequence of letters “cat”, or the pattern can be complex, such as the string must start with a protocol identifier, followed by two literal forward slashes, followed by…, and so on. This is cool in theory. But what makes reqular expressions so powerful is what you can do with them in practice:

-You can test a string to see whether it matches a pattern -You can extract from a string the sections that match all or part of a pattern. -You can change the string, replacing parts that match a pattern

The job I needed regular expressions for in my code is most likely based in the poor design of my deck of cards. The following is the code that initialized a new deck:

def create_a_deck
  new_suits = %w(hearts spades clubs diamonds )
  new_value = %w(Ace 2 3 4 5 6 7 8 9 10 Jack Queen King)
  @new_deck = Array.new
  #creates a new array by combining the information in the
  #above two
  new_value.each do |card|
    new_suits.each do |suited|
      @new_deck << "#{card} of #{suited}"
    end
  end
end

What I am doing above is creating an array of strings that have combined the strings found in the “new_suits” array and the “new_value” array above to make a new array that includes an entire deck. The iterator starts with “Ace” and combines it with “hearts” to make “Ace of hearts” which is then added on to the end of the @new_deck array. The iterator goes through and makes 52 cards in this fashion.

The problem with this method of making a deck is that all of my cards are now Strings and I need a way to covert them into point values for the Black Jack game. I did some research and came upon regular expressions.

Here is the method I used to parse the deck and assign values:

def card_value card
  if card =~ /Queen/
    10
  elsif card =~ /King/
    10
  elsif card =~ /Jack/
    10
  elsif card =~ /Ace/
    11
  elsif card =~ /2/
    2
  elsif card =~ /3/
    3
  elsif card =~ /4/
    4
  elsif card =~ /5/
    5
  elsif card =~ /6/
    6
  elsif card =~ /7/
    7
  elsif card =~ /8/
    8
  elsif card =~ /9/
    9
  elsif card =~ /10/
    10
  else
    0
  end
end

I have a gut feeling that any rubyists that are reading this, died a little bit inside with that method. However, it got the job done and it taught me a little about regular expressions. Essentially what this method does is search the string I give it (I’m using this with an iterator and passing it each card in the player’s hand) and assigning a value based on what it finds. I will probably add another method to this in order to expand upon the Ace, but more on that later.

Problems I faced:

So there are a couple parts to blackjack that were a little tough for me to get in the program. They are, dealer play, the option of playing an Ace as a 1 or 11, and the ability to bet.  I am not going to attack the betting capability just yet but I do think I will discuss dealer play and  Ace action.

Dealer Play:

On the surface, this problem seemed pretty simple. The dealer is just a special player. So, create a subclass of player and write some methods that automate the play of the dealer (I won’t paste all that code here, go look at the source!). However, every time I called a method from the dealer class my program crashed. I have to keep fiddling with that to see if I can get it to work.

Ace Action:

I actually think I solved this problem while I was writing this blog post (which is why I write this blog). I think if I add call a method in when the card_value method finds “Ace” that prompts the user to make a choice, it will solve the problem. The tricky part will be offering that choice repeatedly (so if the user changes his mind later in the hand) and automating it for the dealer.

Features to come:

So you can probably gather that I plan on adding the above two features today. Another feature that I want to add is the ability of the user to place bets, have holdings and play multiple games.

Please go play the game ($gem install RubyJack) and give me some feedback! Thanks!

I/O…FINALLY!

When I was learning to play the piano, I remember wanting to jump right into Billy Joel. “Hot Cross Buns” and “Mary Had a Little Lamb” were boring and very uncool for an eight year old boy to be learning.

I have had the same feeling while learning to code. I spent a lot of time doing methods, objects and classes never really getting to use them as I would in the real world.

There is one question I wanted to be able answer since the day I started programming: “How the hell do I interact with a program?”

Today, I figured that out. The code below is from the main program file for the game I created in the Pragmatic Studios course. In it, there are two examples of some of ruby’s basic input functions.

knuckleheads = StudioGame::Game.new("Knuckleheads")

default_player_file = File.join(File.dirname(__FILE__), 'players.csv')
knuckleheads.load_players(ARGV.shift || default_player_file)

loop do
  puts "\nHow many game rounds do you want to play?"
  answer = gets.downcase.chomp
  case answer
  when /^\d+$/
    knuckleheads.play(answer.to_i)
  when 'quit','exit'
    knuckleheads.print_stats
    break
  else
    puts "Please enter a number or 'quit'"
  end
end

knuckleheads.save_high_scores

The first input I learned was the “gets” method. Here, the program prompts the user to provide a number, the code checks that it is in fact a number (or a quit command) and then uses the number as an argument for the method.

loop do
  puts "\nHow many game rounds do you want to play?"
  answer = gets.downcase.chomp
  case answer
  when /^\d+$/
    knuckleheads.play(answer.to_i)
  when 'quit','exit'
    knuckleheads.print_stats
    break
  else
    puts "Please enter a number or 'quit'"
  end

The next one is a little more complicated so I will try to break it up into pieces.

What I am trying to accomplish is to allow non-programmers to add players to my game using a csv file and no code. They should be able to simply input the name of a player and the program automatically adds a Player object to the game.

To do this I created a player.csv file (in the above code a person could theoretically create their own file and load it in) with a series of players each on their own line. Then I included the following code in my Game class:

  def load_players (filename="players.csv")
    CSV.foreach(filename) do |line|
      player = Player.new(line[0], line[1].to_i)
      add_player(player)
    end
  end

This takes a file (defaulted with my players.csv) and goes through each line of the file, creating a Player object for each one.

Then, I included this in the main program file:

default_player_file = File.join(File.dirname(__FILE__), 'players.csv')
knuckleheads.load_players(ARGV.shift || default_player_file)

This loaded the players from the file given by the user or my default file if none is give and then runs the program as normal.

So, after two months of hard work and a steep learning curve I have completed my first gem! w00t! You can download it if you want:

$gem install blam_and_woot

If you want to peek at the source code you can find ithere

I will be writing about packaging the gem and some issues I ran into with that later. For now, I am celebrating!

Sunday’s Challenge

Full of the knowledge gained from Coder Night on Thursday, I made an attempt at creating a poker game. My original plan was to create three classes, a Player class, a Deck class and a Game class. The general construction of the game would be the Game class would use take a new deck object and pop the last card out of the shuffled array and assign it to one of the players in the array “hand”

The first problem I ran into was getting each player cards from the same deck. When I wrote the program the first time I assigned a new deck to each player.

I think I finally figured out the problem there, but I broke the program :/

I am pretty sure the problem is somewhere in my Game class. Any ideas?

require_relative 'player'
class Game
  attr_reader :hand
  attr_accessor :make_game
  def initialize numplayers
    @numplayers = numplayers
    hand = []
  end
  def make_game
    i = 0
    while i < @numplayers
    hand << Player.new()
    i+=1
    end
  end
end

Yeah… I’m a Bad Blogger.

I’m coming back now, I promise

I’m sorry, audience of zero, I haven’t been updating you on my learning process or helping you keep up. The problem is, I have been moving way too fast to write about it every day. So, to update you:

HTML:

While I am no master, I plowed through my HTML book and felt comfortable enough to move on.

CSS:

I know the concepts of CSS, I know what it can do and I know where to look up commands, I think I will get better by doing. So the blog originally was for you to learn with me and I dropped the ball on keeping up with it. Sorry. So, Where am I now?

JavaScript

I have been playing around with codecademy for a few months now and I love it. The exercises are challenging and you have a lot of freedom to mess around. It was a great intro to programming and I have since expanded my pursuits!

Ruby

Through the urging of my wonderful friends Jessica Barnett and Aubrey Goodman, I decided to pursue Ruby. I love it. Actually love is a gross understatement. When I sleep, I have dreams of objects and methods dancing in my head (you think I’m joking). I am currently working my way through the Learn to Program by Chris Pine (highly recommend) and a course offered by Pragmatic Studios (equally awesome). Needless to say, I don’t want to do anything else but program in Ruby for the foreseeable future.

General Computer Science

For this I am reading Schaum’s Outline which moves really fast but is completely worth the effort. I think this will prepare me well for some further exploration into algorithms and databases.

Java

I am also going through Standford’s Intro to Programming Methodology and Computer Science class to hopefully give me some training in larger theories and best practices of software design. So, yes I am busy. I will however try to post more often with some tidbits, challenges and advice I pick up along the way. I hope you continue to read!

HTML Meet Style

Sorry for the unannounced absence. Life gets in the way. Let’s look back at what we have learned so far: First, we learned about how to secure a domain name and set up hosting. Next, I introduced you to HTML and how it fits in the web. After that, I showed you what a simple HTML document looks like. Finally, I showed you how to set up your text editor and your website’s folder. Today we are going to learn some basic styling and introduce the “style” element to your HTML document. NEWS FLASH: It is no longer 1999 and we can’t use HTML to style our webpages…Gasp. I know that is common knowledge to most people in web design, but don’t roll your eyes at me. It is a misconception many beginners carry. I won’t be teaching any CSS today, just showing you where it fits in and what it does. So let’s go back to the code from the earlier lesson:

That code gave us this web page:

Now take a look at the same code with a little CSS thrown in:

Notice that I threw in a “Style” tag. The tag has an attribute, text/css. This tells the browser that we will be styling the website with CSS. I won’t tell you exactly what each one does, try to figure it out based on the picture below.

So what did the CSS accomplish?

Setting Up Your Website

Homework Answers:

<html> and </html> let the browser know where the html document begins and ends <head> and </head> starts and ends the page “head” <title> and </title> Gives the page a title <body> and </body> starts and ends the “body” of the document. <h1> and </h1> changes the formatting of the enclosed text to the size of  heading 1 <p> and </p> shows when a paragraph begins and ends <h2> and </h2> Same as heading 1 except slightly smaller.  There is a total of 6 heading sizes

Today’s Lesson

Setting up your website

In order to begin creating your website you have to first choose a text editor. If you have a Mac you can use TextEdit. If you have a PC, Notepad comes standard. Thanks to Jessica I will be using TextMate which is a text editor made specially for developers. So open up the text editor of your choice and make sure that it is set to a plain text format (not necessary if using TextMate)
Save the file as “index.html” to a folder called “learnwithjeff.”
Now, try creating a file like the one I did in my previous post. Once you have finished open the file using your browser and check out your first HTML website!  

A Quick Look at HTML and Your First Assignment

Hello! Today we are going to look at a little basic HTML. I’m running behind so this will be a short post. This is what a (super) basic HTML file looks like:   This is what that file looks like on a web browser:  

Homework:

Your homework for tonight is to compare the two and make a guess as to what each tag does. Tomorrow we will go over it.