Entries Tagged 'rubyonrails' ↓
September 19th, 2007 — montreal, startup, rubyonrails, tech
It’s on the company blog, and Marc-André blogged about a typical day here at the office. We need another Ruby developer - either a “Guru” or a “Devotee”. I wasn’t going to blog about it, having sent email / IMs to people to encourage them to apply for work here.
The answers I got were surprising. The main question was around compensation.
Here’s the scoop: pay is above average for Montreal. Plus benefits. Plus stock options. Plus working with an awesome language, a beautiful framework, under good working conditions (read Marc-André’s blog post!)
Now, here’s scoop #2. Marc-André and I will also be interviewing candidates. We have high standards: we are looking for other passionate people. We want people that enjoy coding and are continually learning.
If you don’t have passion, you shouldn’t bother applying. If you do, we expect you’ll have code to show us - although it might be Python, Erlang, Javascript or another cool language.
August 8th, 2007 — rubyonrails, tech
Marc-André’s presentation last night at Montreal on Rails rocked. He tackled the issue of making unit tests faster by mocking web services.
It was a timely presentation, with at least one RoR shop in the city feeling the pain of testing models that depend on those services. When tests run slow and are difficult to write, we obviously want to write fewer of them.
July 17th, 2007 — startup, rubyonrails, tech
Ben and Fred at Standoutjobs got me to move from Quebec to Montreal to become a Ruby Guru. I will be guru #2 after the very talented Marc-André Cournoyer. Like him, I now have a standard-issue MacBook Pro with a second screen.
I was very reluctant to leave beautiful Quebec city. I had a great apartment downtown on St-Jean street and was looking forward to a summer chilling on terraces.
They have a convincing pitch, and the project is ambitious. Ben, Fred and Austin have all had previous business success. With such a track record, and by recruiting people like Marc-André, they are very likely to succeed. This should be fun, and a great learning opportunity.
June 12th, 2007 — rubyonrails, tech
I just got my hands on a postal code file. First, we cut out other provinces we don’t need:
grep '^"[GHJ]' POSTALCODEWORLD-CA-GOLD.CSV >> quebec.csv
My first strategy was to use ActiveRecord to create the records. The console code looked like this:
>> post_codes.each_line do |line|
?> fields = line.split(",")
>> PostCode.create(:postal_code => fields[0],...,:street_to_suffix => fields[21])
>> end
I was too lazy to write all that myself, the create was generated. However, the performance was an issue. There are 300k lines in that file, and less than 4k were being entered per minute in the database. From MySQL’s command line, this is what my solution looked like:
LOAD DATA LOCAL INFILE '/Users/daniel/projects/[top_secret]/quebec.csv'
-> into table post_codes
-> FIELDS TERMINATED BY ','
-> ENCLOSED BY '"'
-> LINES TERMINATED BY '\r\n'
-> (postal_code,...,street_to_suffix)
Query OK, 301571 rows affected, 7866 warnings (10.70 sec)
Records: 301571 Deleted: 0 Skipped: 0 Warnings: 0
From > 4500 seconds to 10.70 seconds. Ruby and ActiveRecord can be incredibly slow. And I don’t care, because it’s pretty and easy to use. When I do need execution speed, I’ll use a shortcut; otherwise, my happiness and code writing speed are more important.
June 5th, 2007 — rubyonrails, tech
Originally posted June 05, 2007. Reposting with modifications. Rails readers: anything else to change / add?
After over a year of working with rails, I finally feel safe publishing advice for beginners.
Learning RoR is worth it. It took me a long time, and I wasted much of it figuring out what books to read and what plugins and features to use. This entry is meant to let you avoid those pitfalls and increase your productivity as fast as possible. I’ll break it down in 3 stages.
1 - Basics. Read these books:
You can be productive with Rails without knowing much Ruby. You’ll eventually want to learn Ruby to get the most power out of your new framework and to have more fun. It’s a beautiful language, much of the reason Rails is great. (You couldn’t write Rails in a lesser language like Java).
2 - Write a couple small apps. Chances are you already wrote a couple toy apps in step 1, but you should now try something meatier.
- Put everything in
SVN git right away
- rake db:migrate beats SQL, use it right away too
- If you want users and authentication, start with Restful Authentication.
- For scaffolding, get used to script/generate scaffold_resource
- Unit and functional tests will save your bacon. Often.
REST is the way of the future, and all the cool kids are doing it. I get asked what it’s about and why it’s important, but Mike Clark expressed it better than I could:
[D]on’t feel bad if you’re not up to speed on what it means to build RESTful Rails apps. In truth, we’re all still learning what that means, and I suspect we have a long way to go.
I’ve enjoyed the conventions that fall out of the REST style of design. Things like the named routes and the Simply Helpful plugin tend to give an application a good consistent feel to it. Converting my traditional Rails apps to the REST style has largely been an exercise in removing code, and refactoring for the better what’s left. (What’s On Your RADAR?)
3 - Keep Learning. These are essential resources:
I hope all this saves you some time. If you know of other resources you found really helpful while learning, feel free to share in the comments.