Archive for the ‘Resources’ Category

Rails Tutorial Updated to Support Rails 4.0 Beta

Wednesday, March 20th, 2013

Cool stuff, Rails Tutorial.org has been updated to support Rails 4.0. This is great news as the rails tutorial site is the first place I tend to send people who are interested in learning rails.  Great stuff from Michael!

Learn Python The Hard Way Released

Thursday, November 4th, 2010

Learn Python The Hard Way is a new free eBook by the most epic Zed Shaw, born out of (I think) frustration with other teaching methods in books.  I know it’s not Ruby, Rails, or a combination thereof, but Python and Rails live in a very similar open source, develop/learn in the open community, so it’s worth noting.  Also Ruby programmers more than anyone should be open to learning other languages to improve skills in their own. Also, if you want to work at Google, this is probably a good thing to check out.

And as I say on my other site, hey, free is free :)

Using VIM In Your Workflow

Tuesday, August 3rd, 2010

After a bit of a wait, my buddy Curtis McHale has posted the article I wrote for his site, yourworkflow.ca.  You can check out the Using Vim As A Text Editor article over on the site.  It’s not just about Vim, but more the day to day coding workflow that I was using, so it includes things like Firefox plugins, Unix utilities, etc.

So head over and check out the workflow site and read not only my fine fine article, but also the other news and podcasts he’s got going on over there.

Rails Tutorial Updated To Rails 3.0

Wednesday, July 28th, 2010

Huge congrats go out to Michael Hartl for upgrading his awesome RailsTutorial.org for Rails 3.0.  Now you have the choice of reading the 2.x version or the 3.0 version of the site.  Many thanks go to Michael for his hard work and huge contribution to the Ruby and Rails community!

Is A Site For Ruby Idioms Needed? [Update: Yes!]

Monday, May 3rd, 2010

I’ve noticed lately that there is definitely a “Ruby way” to write Ruby code. When I first read Effective Perl Programming years and years ago I went from writing code that looks like this (note that I know the “FILE” is wrong, but the wordpress auto-syntax highlighter thingy doesn’t seem to deal well with the correct bracketed syntax):

while (my $line = FILE ) {
    if( $line =~ /foo/ ) {
		print "$line";
	}
}

(which isn’t all that un-perl-y to begin with, but that’s 15 years of perl in my brain stopping me from writing really un-idiomatic code) to far more idiomatic:

while (FILE) {
	print if /foo/
}

The point being that there are certain conventions and ways that your programming style will adapt to the given language. The following loop

for (i = 0; i < 10; i++) { }

Is perfectly natural in C, but if you saw it in perl or ruby, while it might be perfectly valid, it would look way out of place in either language, and you’d get funny looks if you presented it to a code review.

In ruby some of these would be to not do this:

t.gsub!(/(http|https)biglonguglyandhardlyworksregex/, "<a href="\">\1</a>")

But instead do this:

    URI.extract(t, %w[ http https ftp ]).each do |url|
      t.gsub!(url, "<a href="\">#{url}</a>")
    end

Or maybe instead of this

sum = 0
list = [1,2,3]
for i in list do
  sum += i
end
# sum is now 6

you use the must more awesomeer (yes it’s a word)

list = [1,2,3]
sum = list.inject(0) { |s,v| s + v } # sum =&gt; 6

Of course, you can write bad code in almost any language pretty easily (note how I’m not making a php/python/whitespace/brainfuck joke here!)

So my question is this.  Is there some grand collection of these Ruby idioms?  Is there a need for them?  Would a fusion of StackOverflow and Refactor My Code be a useful collection to have somewhere?  Or are the resources out there (which are a bit scattered) good enough?

So far I’ve found:

Alternatively there are a lot of places where you can read other’s code to learn idiomatic Ruby by osmosis.  Github, RefactorMyCode, the popular Gems in the community, The Ruby Quiz are all great resources for this.

My vision is a melding of StackOverflow (maybe using their new StackExchange community software?) and Refactor My Code where you can search for an idiom or programming operation based on code, Class, or tag, vote, and comment or submit a different version.  Sort of like a Perl Golf contest except instead of the fewest keystrokes being the goal it’s the cleanest/nicest/most effective way of doing the operation.

So what do you think, would this be useful to work on with the Ruby community, or is there enough information out there already that is google-able enough?  Everyone will also have their own way of doing things, but Ruby is an opinionated language (or is that only Rails?) so maybe there is One (or two) “correct” ways to do things.

Your thoughts appreciated.

Update – So a bit of discussion here, and lots of great comments on proggit show me that this idea does deserve a go of it.  I’ve registered ruby-idioms.com (pointed here for now) and hope to have something up in the next couple of weeks, and will take a few beta tests to have a run at it.  Keep an eye here for any news by subscribing to the RSS or following me on Twitter.  Thanks everyone!

Favorite Ruby and Rails Podcasts

Tuesday, April 27th, 2010

Podcasts have been a great help to get some great information about Ruby and Rails, as well as to discover and connect with more of the community.  I figured I’d list a few that I listen to, and would appreciate folks passing back any good ones I might be missing.

Some will be old hat to the ruby folks, but there might be some new ones that could peak pique your interest.  If you’re a newbie to Rails like me, I suggest you add these to your podcast watcher of choice immediately!  Most of these will fall into either the “news of the week”, “interviews”, “howto” or “training” categories.  I’ll categorize them for you a bit so you can pick and choose if you prefer one or the other.  There are a few that I’ve picked out that aren’t strictly Rails or Ruby oriented, but they still get prime location in my weekly podcast listening.

  • Coderpath [itunes] (audio,interviews) @milesforrest and @curtismchale
    Ok, so even though this is a bit of shameless not-quite-my-own self promotion, and Miles and Curtis are buddies of mine, I do have to honestly recommend the Coderpath podcast.  They do interviews of some of the big names in the Rails community such as DHH, Ryan Bates, Wayne Seguin and others, and ask a lot of good questions about some of the “how” of the community, the sort of questions someone like me might ask (and I do).  Also keep an eye on Miles’ twitter feed as he’ll send out where you can submit questions for the podcast.
  • RailsCasts [itunes] (video, training) @rbates
    Ryan Bates’ great podcast is a staple of the Rails community, and he gives short, bite sized chunks of information on different aspects of rails programming.  One week it might be how to do something like nested routes, another will be a series of Rails 3 howtos.  Awesome stuff.  Personally I’d recommend watching these and not deleting them, so you can go back for further reference later on.
  • Rails Coach Teach Me To Code Podcast [itunes] (audio, interviews, training and howto) @charlesmaxwood Note: Updated link, RailsCoach is now Teach Me To Code Podcast
    This is a recent discovery of mine, and Charles does a great job in intermixing interviews and talking about how to do various issues, such as finding a mentor or how to take the best advantage of your first (Rails|Ruby)Conf.  My favourite part of this podcast is that he seems to be (and no insult intended) about on my level, or a bit above, so a lot of the questions he asks would be pretty much exactly what I’d want to know in the same situation.
  • VimCasts [itunes] (video, training) @nelstrom
    Not purely a Ruby or Rails podcast, but vim is a skill that every programmer should know, and Drew does a great job in giving both a newbie friendly, and old-hat educating, series of screencasts.  If it says anything to you, I’ve been using vi and vim since around 1995 and was still learning things from the first podcast.  Great stuff in easy to digest chunks like RailsCasts.
  • RailsLab Scaling Rails [itunes] (video, training) @greggpollack
    This is a 21 part series that isn’t being updated anymore, but is a must-watch for anyone who wants to know a bit more about Scaling Rails.  This isn’t going to be applicable to 90% of what 90% of the audience does, but is still invaluable information in giving you the background information to know why certain decisions you make in technology can have big (or small) impacts on scaling down the road.
  • Your Workflow [itunes] (audio, interviews) @curtismchale
    Ok this is another bit of not-quite-my-own self promotion, as Curtis is a buddy of mine from the Fraser Valley Ruby Brigade (FV.rb).  This podcast addresses a niche that isn’t really addressed in other places, and takes that tack of “how do you get your job done” and talks about the workflow that people have.  Curtis is a designer and so far his interview has focused on wordpress development, but the site and podcast is all about people’s workflow, and you’re sure to find something new.
  • Ruby Pulse [itunes] (video, training) aaalex
    Ruby Pulse is to Ruby what RailsCasts is to Rails.  Alex takes a small chunk of code, a gem, or technology concept and works with it in a 5-10 minute podcast.  Ruby Pulse is unique is that it’s done in one go, with no editing, so as the intro says, sometimes unexpected things will happen.  More often than not, you’ll get a nice introduction to a new and interesting gem or two.
  • Ruby 5 [itunes] (audio, news) Envy Labs
    Ruby5 is the bite size chunk news show, and gives you the Ruby and Rails news of the week in a five minute podcast a couple of times a week.  Ruby5 was split off of Rails Envy for people who wanted their news a bit more compressed and less “chatty”.  Great way to hear what’s new and interesting and keep yourself right on the edge.
  • The Ruby Show [i], The Dev Show [i] and other good stuff from 5by5 (audio, news, interviews)
    Those familiar with Rails Envy will recognize these as cut from that tree.  5by5 has a very good series of podcasts with various names in the Rails and open source community, and has a great mix of news and interview shows.  The Ruby Show and the Dev Show are the ones that are on my podcast weekly, but I’ve also recently discovered The Pipeline, which is an interview show with innovators and newsmakers, and it deserves a listen as well.
  • Stack Overflow Podcast [itunes] (audio, news, howto and interviews) @spolsky and @jeffatwood
    Another not-really Rails oriented, but Joel Spolsky is a name that should be familiar to anyone doing development, as will StackOverflow.com.  You’ll also recognize Jeff Atwood from his great codinghorror.com site.  The guys get into some of the programming practices they follow, business, and interviewing people in their circle.  It’s a really interesting look into the development and business of the StackOverflow community.  Just ignore the whole “.NET” thing :)
  • The Changelog [itunes] (audio, interview) @adamstac and @pengwynn
    These are the guys behind tail.thechangelog.com and the github.com/explore pages, and give a great weekly interview with someone in the open source community, and really get into it from the philosophical point of view.  Being able to get a dose of what’s going on in the Open Source community is definitely an asset and their show (and the opening and closing music) is my Saturday must-have-on-while-driving podcast.
  • 37signals Podcast [itunes] (interview, howto) @dhh and @jasonfried
    If you ask for a Rails oriented podcast, how can you not include one from the company that started it all.  This one features DHH and Jason Fried sitting down and talking about all things community, rails and 37signals related.  Sometimes they are just chilling talking about Rails, sometimes it’s interviewing the sysadmin team, and somtimes it’s chatting about how the business side of the uhm, business works.  DHH is never one to hide his opinion about things, so it’s always a great and educational listen.

So there you go, hope you enjoy the list and find something new.  Remember though that you don’t want to get caught up in listening to podcasts about coding, and forget to do the coding yourself.  These will definitely give you a boost of inspiration, training, or just a weekly re-connection with the community.  Also please comment if I’ve missed any good ones!