Topic: ruby

What is the ideal Senior Developer skillset?

IMGP3922

We're currently in the process of interviewing candidates for 1-2 Senior, and 2-3 junior level Rails Developers, and I'm wondering about the skills that are most critical, and how best to identify the best candidates.

My normal interview process flows like this:

  1. Quick Phone screen evaluating basic development skills, background, availability, personality
  2. Basic coding problem (less than 1hr to complete)
  3. Phone call to review coding problem, 'how would you handle X?' questions, etc
  4. On site interview targeting: Communication, Communication, Communication, (and tech)
  5. Final decision

Independent of the language they will be working with, I've found decent success with having candidates answer some standard dev questions, solve a basic coding problem, and demonstrate their ability to whiteboard a design.

The problem is that it doesn't scale. When we've opened up positions in the past, either Senior or Junior, there have been so many applications that its hard to contact them all. This leads to a reshuffling of the tasks and matching criteria, in an attempt to identify the 'best' matches, and 'filter out' the others.  So instead of calling each candidate first, we might simply reply to them with the details of the coding assignment. I've seen 40 people send the "I'm an extremely hard worker, very interested in your position and would do anything to join your wonderful company" cover letter and resume, and then get whittled down to only 10 candidates that actually submit the assignment.  (Note to applicants: 'showing up' is an important first step!)

I came across an interesting post titled '11 tips on hiring a rails developer' which mentioned some 'filtering' criteria to identify the best candidates

You can read the full description of each one, but there are a few of these that I wanted to highlight:

  1. Don't use Monster.com or recruitment agencies.
  2. Poach Talent from other companies!
  3. Don't hire someone that doesn't know Rails at all.
  4. Look for open source contributions.
  5. A personal Rails blog is required.
  6. A university degree is not important.
  7. Be wary of holes in proficiency.
  8. Avoid brand-name superstars.
  9. Hire perpetually.
  10. Have a company Rails blog
  11. Special compensation.

So each of these tips is meant as a heuristic or proxy of the true underlying ability. Any time you are making generalizations you are going to miss out on a few exceptions, but hopefully you end up with what you are looking for.

Starting with the most controversial first, (#5) while I like the idea of giving a strong preference to someone that has a rails blog, and loves  Ruby, Rails, and Web Development enough to be opinionated and spend their own time ranting about it, I'm not sure I could make it a filtering criteria. Doesn't that seem a bit strong?

I feel the same about (#4) Open Source contribution. I think its great if they have it, but I'm not sure I would reject any candidates that haven't contributed to open source.

While I've met many systems administrators that (#6) don't have a degree, and are very good at their craft, I haven't really encountered many solid developers that don't have a degree. That's not to say they aren't out there, I'm just saying I've never encountered them, and I'm reluctant to use it as a filter. Do you think that there are many strong Rails developers out there without degrees? (I don't care if they have a CS degree, but I think I prefer that they have some kind of degree)

As it relates to (#1) and (#11), I know for sure that the economics of finding a candidate through your own network and contacts can be less expensive than the recruiter fees (assuming you find a decent candidate and don't waste a lot of your own time doing it), and if you are able to find someone directly, it frees up cash for such amenities as 'New Macbook Pro', 'RailsConf', and 'Fridge full of XXX'.

If I was in charge of everything

I really like what Andy Singleton describes regarding how his team at Assembla is organized and tackles Agile Development, and on the right project, I'd really like take his advice and try this one:

"Don’t interview. Just pay people to join a project, pull a task from the queue, and find out what they can do."

Anyways,  I'd be very interested in your thoughts regarding what makes for a Solid Rails developer, where you find them, how you keep them, and what you've learned.

(Oh, and if you know any passionate Rails Developers in the Chicago area, send them over!)

GWT and the Static Versus Dynamic Religious War

Never get involved in a land war in Asia.

-- Vizzini, The Princess Bride

.

gwt
Also, never get involved in a religious war about statically versus dynamically typed languages. Well, maybe just this once. :-)

Periodically, an angry Javascript developer will let loose and flame GWT as a misbegotten spawn of evil. Then all the GWT developers point and chuckle and move on to developing more cool applications. Every so often, though, someone will make a thoughtful comment about GWT, and then we have a fruitful discussion that helps clarify what GWT is and what it does and doesn't do well.

William Shields has either posted such a thoughtful comment or a very high end version of a flame, entitled Lost in Translation or Why GWT Isn’t the Future of Web Development. It is well worth reading, along with Google's Joel's somewhat heated response.

Continue reading »

Rails DateTime.to_time, Time, and a case of ‘Why do you need to do that?’

balboa_clock

The problem: I needed to display a warning to a user if the data they were looking at was more than 90 days old.

The solution: Create a method that takes 2 dates (either DateTime or Time), and returns the number of days, or hours between them.

  def self.difference_in_dates(date1, date2, unit = 1.day)
    return nil if date1.nil? || date2.nil? || unit == 0
      (( date1.to_time - date2.to_time ) / unit).round.abs
  end

The problem was simple enough, and my tests were all passing, so I moved on to my next task.

That code has been out in production for several months, but earlier this week, a new developer told me he got an error when running the test:

  NoMethodError: undefined method `to_f'
    for Mon, 21 Sep 2009 14:29:38 -0500:DateTime

(we're running this in Rails 2.0.2)

I looked at the code, knowing it was working before, ran the unit tests myself, and didn't see the issue. Now I'm on Windows and everyone else is on a mac, so as soon as I run into an issue that no one else has seen I want to prove if its a Windows problem. But wait, this test has been running in our Continuous Integration server (Hudson) for months, and no one else on the team ever had any issues with it, and the code has been working in production without any errors in the logs.

I jumped into rails script/console to see what's up, and here's what I found:

 >> x = DateTime.now
=> Wed, 23 Sep 2009 00:00:00 +0000
>>; x.to_time
=> Wed Sep 23 00:00:00 UTC 2009
>> x.to_time.to_f
=> 1253664000.0

Which is what I expected, but when I asked the other developer to run that same instruction, he got an error.

>> DateTime.now.to_time.to_f
NoMethodError: undefined method `to_f'
  for Mon, 21 Sep 2009 14:29:38 -0500:DateTime

What's up with that? We're running the same code, and all of our libraries are the same version. Looking at the date value in his error, I saw the timezone, and decided to try this variation locally:

>>  x = DateTime.parse("2009-09-21T14:29:38-0500")
=> Mon, 21 Sep 2009 14:29:38 -0500
>> x.to_time.class
=>; DateTime

So I'm gathering that when there is a timezone and you ask DateTime.to_time, its just going to give you back a DateTime.
Continue reading »

What’s the best way to programmatically edit a pdf in ruby?

I've been doing a good deal of PDF generation in Rails, and had to go through the process of comparing all the available techniques and frameworks in order to find the right solution for my needs.

Its great that there are so many tools out there, but it can be a daunting task to figure out which is best, which will scale, which will continue to grow and improve, and to evaluate the true 'cost' of free vs. commercial.

With all this info finally digested and sorted out,  I was surprised when I got a client request to be able to add a banner to an existing pdf, and from what I can  recall, none of the libraries I know about seem able to do this.  Right now, I'm in the middle of googling the hell out of it, but haven't found my silver-bullet answer yet.  (maybe I should ask jeeves?)

I've done various searches and have come across a few categories of PDF tools:

  1. Wrappers to existing pdf generation tools like fpdf, and iText
  2. PDF Template tools where you build a pdf skeleton file, and bind values to it programmatically
  3. Pure Ruby PDF Generation tools
  4. PDF Readers and inspection tools

I did find a discussion about how this could work on Google Groups between Greg Brown creator of Prawn and Ruport, and James Healey developer of PDF::Reader, but that discussion basically ended with, "Yeah, that would be cool!".

At this point I'm looking into the Origami library which is actually designed for pdf 'security' and testing, and isn't explicitly designed for editing pdfs in this way, but at the moment its the leading candidate in my list.

Have I missed something? Is there an obvious way to do this in ruby/rails that I'm completely overlooking? (I haven't looked very deeply at tools that shell out to the bigger libraries, but I wouldn't rule them out)

The initial requirement was to be able to add a banner/header to an existing PDF, but I can see the complexities of determining how to shift the existing content down without screwing up all the formatting, so I think even being able to insert a coverpage might be a suffcient implementation for now. (Maybe I should be searching for pdf 'merging' instead of editing)

I'll update you with my final solution in an upcoming blog post, and I'll be covering all of the info I've learned on PDF Generation tools for Ruby and Rails  at this year's WindyCityRails Conference on September 12th. Drop by http://windycityrails.org to register. (early registration ends Aug 1st)

ChicagoRuby meeting ‘Test Prescriptions’ recap

chicagorubylogo

The ChicagoRuby users group (not to be confused with chirb.org another great Chicago Ruby user group) held their second meeting at their downtown location.

While the meetings out in Elmhurst are always informative and helpful,  the downtown location may allow for a bigger crowd, and the weekday time might work better for more people. Plus, the Illinois Technology Association - Tech Nexus is right next to Union Station which works great for people that still have to go out to the suburbs.

Noel Rappin's talk covered some of the most common questions he gets through the Pathfinder Development Blog, and his own site RailsPrescriptions site RailsRX.com dedicated exclusivly to testing.

There's too much detail to cover here, but at a high-level, Noel covered:

  • The why, how, when, and where questions that make the foundation of a good testing approach
  • Testing techniques for legacy projects
  • A good review of the different testing frameworks, what their differences are, and some discussion about each (test::unit, shoulda, rspec, cucumber)
  • A solid review of different factory tools that go beyond standard fixtures (Factory Girl, Fixture Replacement, Machinist, and Object Daddy)
  • Strategies for migrating from Fixtures
  • Differences between the mocking frameworks:  Flexmock, mocha, rspec, and RR (double ruby)
  • Finding the right balance, and avoiding the pitfalls of 'over mocking'
  • Cucumber testing workflow (and where cucumber doesn't work well)

The audience seemed to have a wide range of experience, but all had opinions to share about what they've learned about testing.  After the talk everyone seemed fell into small groups to network and exchange ideas and contact info, and a group gathered around Ray and Noel as they tossed around some ideas on potential future meeting topics "Ruby IDE/Editor review", "Rails Jumpstart", "Coding Dojo".

The organizers took a stab at hosting the meeting virtually over gotomeeting (not sure if it was recorded or not).

Their next meeting is scheduled for July 18th, details can be found in their meetup.com group.

windy_city_logo

The organizers of the ChicagoRuby.com group are also the organizers of the 2nd annual WindyCityRails Conference right here in Chicago, on Sept, 12th, which Noel will be presenting at.

How to learn a new programming language or framework

bunny_tutorial.jpgWhile never untrue, it is more of a necessity now, that a programmer should know more than just one language or framework. After being a focussed Java/J2EE developer for a long time since college, in the last couple of years, I plunged into .NET, Ruby/Rails and then Javascript/prototype/jQuery etc and now onto groovy/grails. With name like Erlang, Scala, Compass, git, blueprint, flex flying around us everywhere, it can be overwhelming and we need a plan to pick, peruse, acquire them. Here is a list of things I do when learning a new skill.

Continue reading »

Stick with ERB or move to Haml

haml.jpg Haml is gaining popularity in Rails community. It claims higher productivity compared to defacto ERB templating. Not everybody agrees though. I see 2 short-term problem with haml.

  1. ERB is similar to it pre-decessor and hence easier to learn. Compared to JSP etc. ERB is similar, you still see lots of HTML tag with interleaved ruby (or Java). Although verbose, it is closer to how your HTML would finally look like.
  2. If your team has a dedicated HTML programmer (Designer as we may call them). These folks are very good at plain HTML and don't want the trouble of converting files and having all the plumbing around when working. It is not efficient for them.

Despite this, I see Haml as valid alternative for following reasons:

Continue reading »

Topics: , , ,

What makes Ruby/Rails Development Fun

I have been a full-time Ruby programmer for about a year now. I used ruby/rails before then but I didn't really "get it". Considering that I was a Java/J2EE guy before and never worked with dynamic languages, it wasn't surprising. Now that it has been a transformation and a worthy evolution, it is about time to review what makes ruby development fun. Yes, Ruby is known for its dynamism, expressiveness, malleability. But today I hope to list a few tools, techniques, concepts that make my programming experience fun these days. Here they are:

Continue reading »

Fun with Math

Triple Orange Peel
Creative Commons License photo credit: fdecomite

Math is fun!

I never understand why people hate math so much.  I guess I hated history & literature as much as fans of those subjects hate math.  I remember always hearing that you would never use math in real life, which is just not true.  I use it all the time, and this post is about one of those times.

A coworker of mine is creating an iPhone app, and whenever he encounters tricky math, pulls me in, as he realizes I have fun with it.  His problem was:
given two points on a circle, find the shortest number of degrees between them
So given points at 4° and 20°, the result should be 16°.  Seems easy enough, except a few fun scenarios.  356° and 4° results in 8°, and 360° and 0° are the same.

I thought through it, and my original approach was going to figure out what quadrant each angle was in, and then do some calculations to adjust the distance to keep the answer <= 180°.  But then I realized that was going to be nasty, and then I remembered our good friend the radian.
Continue reading »

Topics: ,

Uploading Files to Rails Metal

I was fooling around with Rails Metal earlier today to get a better feel for it. One of the most obvious uses for me is disassociating an upload task from your application; a single Rails instance blocks while waiting for an upload to finish, so particularly for very large file uploads, your application can stop responding to users if all instances are taken up by uploaders.

With Metal, you can spawn separate tasks on different process IDs: then when you need to upload, Rails calls to them and that Metal handles the upload (and blocks), while the application instance itself is free to service other requests. This article was super helpful in describing how to use Rackup to start a Metal piece as a separate process. But in all my searching I didn't find anything clearly delineated on the Internet for how to make Metal work with file uploads, so this is how I did it.

Continue reading »

deprec is good, but needs taming.

I recently had to work on some deployment tasks and used deprec gem to check out how it can help. deprec is one of the most admired gem outside of pure rails application deployment arena. It is one of the most successful attempts at demonstrating how capistrano can be used as a more generic deployment tool and not just for deploying rails apps.

However, there are a few design choices that I think warrants more thought if I were to continue to use it successfully for all my deployment needs.
Continue reading »

handling CRLF in git

If you use git on windows or cygwin, I am sure you've encountered this.

$ git add dir/newfile
fatal: LF would be replaced by CRLF in dir/newfile

While there is much confusion/discussion around how to handle this using core.autocrlf and core.safecrlf config attributes, I have lately settled with this recommendation:
Continue reading »

Topics: , ,

getting user.home in ruby

If File.open("~/etc/my_config_file") doesn't work for you, try File.open(File.expand_path("~/etc/my_config_file"))

Not sure, why File.open() does not handle this internally?

Topics: ,

ActiveRecord create_or_update based on natural-key

Have you often run into a situation where you have a hash full of properties and you want to either create a new ActiveRecord object (if it doesn't exist) or update one (if it exists)?

For example,

class User
  # has properties: ssn, first_name, :last_name, :age, :email, :password
  def create_or_update_by_ssn(params)
    user = Disease.find_by_ssn(params[:ssn])
    if user.nil?
      user = User.create(params)
    else
      user.update_attributes!(params)
    end
  end
end

Here, the business rule states that a user's SSN is unique, so called natural-key.

If we can identify what constitutes a natural-key for each model object in our domain-model, when we could DRY out this functionality.

Continue reading »

Ask the readers: How do I fire native browser events in Prototype.js?

I've been pairing with my colleague Noel Rappin on a cool Rails project lately, which has helped me turn a bunch of conceptual knowledge into real-world experience. I'm writing Ruby code, doing things the Rails way, and hewing faithfully to test-driven development.

I'm also returning to Prototype for my JavaScript needs after almost 15 months of daily jQuery use. The framework has matured nicely while I've been away. One surprise popped up today, however: Prototype 1.6 lacks the ability to simulate native browser events. jQuery offers this in the form of jQuery.trigger, which can simulate both native and custom events. But Prototype's Element#fire supports only namespaced custom events. (Read this mailing-list thread for more analysis.)

I did a couple hours of digging around today - including a trip to Scripteka - and haven't really found a canned, cross-browser solution to this issue. I'm looking for something that offers jQuery's native event firing in a tidy little Prototype extension. Anyone know of such a tool?

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com