Sunday, May 5, 2013

Ruby for non-programmers and managers: Why Ruby...and a few tips on how to get started


There is a ton of other MUCH more useful stuff on the web about learning ruby & rails...This is my attempt at writing up something useful to help a few non-programmer friends get up and running with Ruby on Rails and something I can cite in the future when non-technical people ask me about Ruby.

Why Ruby (the programming language)?


Most developers will tell you, "Ruby is so dang nice cause it's elegant, expressive, and X, Y, Z".  It's true.  As a non-programmer, however, you're probably saying, "Who cares?".  Here are a few alternative perspectives.

Because it's being adopted at a very fast pace

The first graph below illustrates that Ruby has a relatively low percentage of jobs with this skill in their descriptions.  However, the second graph shows the precipitous ~5000% growth its seen in the last few years. Ruby is an up and coming language.  This is a good thing.  The more widely a language is spoken and written, the more valuable it becomes.


Because Ruby is a really productive and maintainable language


On AstonJ's blog post about "what's so special about ruby", he has 3 examples of the same functionality in PHP, Python, and Ruby.  By word count, we're at 32,26,25 words (respectively), so one might say that Python and Ruby are at parity in terms of conciseness and power.  However, take a closer look at that code.  Even if you don't know a damn thing about programming, the Ruby code is very readable, whereas the others seem pretty weird to a non-programmer.  The non-programmer perspective on why this matters is that when brain's spent less time decoding complex syntax, they are freed up to work on more interesting problems like solving business problems.


If you want to learn Ruby...here's what I'd recommend

  • First and foremost: Get a working Ruby environment up and running! Don't read for hours and hours without trying the examples. ( i suppose you could use TryRuby...but...) Having made this mistake myself many times, I firmly believe that reading without coding is like skimming through a grammar book on Swahili and expecting that if you do it long enough, you'll eventually speak Swahili, NOT TRUE.  Always balance your reading with your writing.
  • Peruse and study the many awesome things on this sample learning plan. There are a bazillion good resources for new programmers there including TryRuby, RubyMonk, and the Learning to Program book.
  • As far as book publishers go: I love Pragmatic Programmer, they publish great books on Rails.  The Agile Web Development on Rails is the quintessential book for learning Rails.  As AstonJ says, however, learning Ruby before Rails can be a good way to go. 

Getting a Ruby Environment Setup: Workstation

  • If you are using Windows, get a Mac...or use VirtualBox + Ubuntu + for your base OS.  The rest of these instructions might not be that good cause I use a Mac, sorry, :(.
  • If you are using Mac, get homebrew

Getting a Ruby Environment Setup: Command Line

  • Install git (`brew install git`)
  • Use homebrew to install rbenv (a tool that lets you run multiple versions of ruby)
  • Install Ruby with rbenv (likely something like `rbenv install 1.9.3-p327`) 
  • Install Ruby on Rails: `gem install rails`

Once the Dev Environment is Setup: Tinker

One of the worst things you can do as a programmer is code in the dark, i.e. code without knowing what it's doing.  The more visibility you have into the program you are writing the better off you'll be.  Rails provides numerus tools to help with this.  My favorites:

  • rails console: For interacting with the models + helpers associated with your Rails app
  • ruby debugger or pry For dynamically interacting with your Ruby program while it's running.

Other learning resources

  • api.rubyonrails.org + http://apidock.com/ruby (for older versions of Rails)
  • RailsCasts (short videos)
Okay.  That's enough.  




1 comment:

  1. Ruby on rails is most productive web developing skill. I am so interested to Learn Ruby on Rails and your post is very useful in this case.


    ReplyDelete