What Ruby Knowledge Should I Have

what Ruby knowledge should I have?

This is sort of from the top of my head; I'm sure I am missing a lot. Besides the things mentioned here, understanding programming and object-oriented programming in particular is a must, of course.

A few important language features:

  • Realise that in Ruby, everything is an expression, and be able to apply that principle, even if you think it makes your code unreadable.
  • Closures are mentioned; I would also expect Rubyists to know the differences between blocks and procs (and lambdas) and know how to convert between them. Closure mastery is important to being able to write beautiful Ruby, in my opinion.
  • Operator overloading: know what happens when you define methods named [], []=, ==, +, <<, etc. on an object.
  • Be proficient with most instance methods of Array, Enumerable and Hash (even if you don't know the exact definition by heart). Your Ruby code will be so much more verbose if you don't use methods like collect, inject, join, zip, etc. where appropriate.
  • Thoroughly understand what Symbols are, and when you should use / avoid them.
  • Understand what metaclasses are, know the difference between class variables and class instance variables.
  • Know how object attributes work in Ruby, how you can define them with attr_accessor and friends, and how you can define them yourself.
  • Be able to use modules, both as mix-ins and as namespacing tool. You should also understand how to mix-in instance methods and class methods (or be able to figure out how you could do it).
  • Know the difference between raise/rescue and throw/catch, and be able to use both correctly.
  • Understand how metaprogramming works, and at least have a basic idea of all the methods that allow you to do metaprogramming (mostly hidden in the classes Module and Object).
  • Be able to use a Hash method argument as a substitute for named arguments (even if it's just because it's a common pattern).
  • Know how concurrency does and doesn't work in Ruby.
  • Continuations, even if they're rarely used.

Some vital tools:

  • Know and understand Ruby gems
  • and rake
  • and RDoc.
  • and YAML.

Some framework knowledge:

  • Basic knowledge of Rails would be useful. Even if it's only because the outside world sometimes doesn't seem to know the difference between Rails and Ruby.
  • Know there are other web frameworks than Rails: Merb, Sinatra, Camping, ...

Ultimately, keep in mind that the above is "just knowledge", and not skills. It's probably easy to pick up most of this if you're not familiar with it.

how to prepare for a Ruby interview in just one weekend

You have no time. If you flop around reading potentially outdated blog posts you're just going to get confused and make no real progress. The Pickaxe book is too broad to really push your knowledge in a short time.

If you only have a couple of days, I'd suggest reading the first five chapters of Metaprogramming Ruby. It's not as intimidating as it sounds, and it will get you up to speed on the things that make Ruby very different from languages you may have used before. The first five chapters would be enough to give you a solid base. You can cover them in a weekend.

If you have time after doing that I'd suggest reading up on RSpec or whatever testing setup your potential employer uses. The RSpec book is a good resource to learn how a Ruby/Rails shop is likely to work.

Others have suggested Agile Web Development with Rails. I wouldn't bother "reading" it at this point. Run through the tutorial if you have time to get an understanding of the Rails vocabulary. Wait to digest the book fully until later.

What do I need to know before Ruby?

You can get straight into programming with ruby.

In terms of generic things to know I suggest you read a book, so you get one consistent message explaining all the basics.

This is a great book to teach you programming in general and it teaches you using ruby.
http://pragprog.com/titles/ltp2/learn-to-program

Also have a go with
http://tryruby.org - Quick ruby tutorial in your browser

Finally check out the hackety-hack project it's designed to help people learn to program, although version 1 is only just out.
http://hackety-hack.com/

how to prepare for a Ruby interview in just one weekend

You have no time. If you flop around reading potentially outdated blog posts you're just going to get confused and make no real progress. The Pickaxe book is too broad to really push your knowledge in a short time.

If you only have a couple of days, I'd suggest reading the first five chapters of Metaprogramming Ruby. It's not as intimidating as it sounds, and it will get you up to speed on the things that make Ruby very different from languages you may have used before. The first five chapters would be enough to give you a solid base. You can cover them in a weekend.

If you have time after doing that I'd suggest reading up on RSpec or whatever testing setup your potential employer uses. The RSpec book is a good resource to learn how a Ruby/Rails shop is likely to work.

Others have suggested Agile Web Development with Rails. I wouldn't bother "reading" it at this point. Run through the tutorial if you have time to get an understanding of the Rails vocabulary. Wait to digest the book fully until later.

What are the most important things to know about Ruby?

Everything (except false and nil) evaluates to true in a boolean context.

This is different from other languages where empty constructs or 0 frequently evaluate as false.

if 0
puts "0 evaluates to true"
end

[Ruby]: Recommended learning approach

Personally I find it easier to learn a language when I've got a project to complete. That's where Rails comes in, by providing a framework for web development, you can make any number of web based hobby projects easily.

Just reading and blindly following tutorials does not help things sink in. Especially when I have established comfortable ways of doing things in other languages.

Ruby is a breath of fresh air coming from the more formal languages in the .NET suite. If you've never worked with any dynamic languages before (Python, Perl, etc) You're in for a ride. The most important learning tool is the Interactive Ruby shell. If you ever want to play around with code just start typing into irb. Books definitely help but just throwing statements and fragments at the interpreter is going to to help you understand what's going on under the hood a lot faster than memorizing method calls and library APIs.

As for books on Ruby look up _why's Poignant Guide To Ruby. It's unlike any other programming book you've ever seen, which is fitting if you come from the .NET side of things where Ruby introduces a number of very foreign concepts. If you haven't done anything with closures before, expect to get blindsided by blocks.

The only hard part of learning Rails and Ruby side by side, is determining what parts of your code are Ruby, and what are Rails helper methods. Stick with it and you should be fine.

As for what can be done in Ruby without Rails? Just about anything. It's a fully featured language, suited for many tasks. But I wouldn't trust it for things with Hard Realtime Requirements

I'm not a .NET person. So I can't comment on the similarities of the relationship between Ruby and Rails and the relationship between c# and ASP.NET. What I can tell you about Ruby and Rails comes from a talk I saw given by Chad Fowler. It was called "Rails is boring, and Ruby is a toy." Which is the most succinctly accurate description possible.

Rails does most of the heavy lifting in your web apps by taking a convention over configuration approach. Meaning if you define things in a manner that Rails expects there's minimal configuration to be done. Rails is a Framework of helpers written in Ruby to implement the MVC methodology of a web service.

prerequisites to learn ruby

In terms of knowledge? No, not really. You'll just need to be prepared for when Ruby does things differently to C-type languages. You'll probably find your workflow changes too – Ruby doesn't have a compile stepº

  • This slide deck looks pretty helpful.
  • APIDock is an invaluable resource for learning standard libraries…
  • Get yourself a decent book (or try a neat online tutorial), and dive right in.

What do you want to do?

  • If you want to build web apps, rails is the obvious and most popular choice, but there are other, lighter options (like Sinatra) available.
  • If you're interested in using it to build desktop apps, then Shoes is a good cross-platform option to explore.

If you're using Linux or OSX (and you probably should be), you should use RVM to keep things tidy, and using Bundler with your projects will protect you from gem versioning hell on any platform.


º Technically, it could, but none of the major distributions compile Ruby to anything…

What Ruby and Rails Developers Ought To Know?

Senior

  • Analyse and profile an application for performance and memory issues
  • Analyses and profile an application for security issues
  • Understand database modeling and query analysis
  • Tune a production deployment (Passenger, Thin, Apache etc)
  • Understand and use Ruby metaprogramming
  • Mentoring skills
  • Communication skills
  • Planning and Estimation

Mid-level

  • Setup and deploy a Rails App for production
  • Understand the Rails stack - callbacks, filters, plugins, engines, gems, rack
  • Understand and use Active Record associations
  • Understand and use scopes to define model abstractions
  • Define tests using Cucumber and rSpec
  • Understand and use Object Orientation
  • Understand and use Design Patterns (explain what they are, know some basic patterns)

Entry Level

  • Create and setup a Rails environment
  • Use generators to create models, controllers and migrations
  • Create and use a migration to manage the database
  • Create a unit test using rspec/etc
  • Create a model and basic validations
  • Handle a GET request using a Controller, Model, and View
  • Handle a POST request using a Controller, Model, and View
  • Basic HTML, CSS and JavaScript
  • Basic GIT - clone, commit, push

How should I learn Ruby on Rails?

I'd definitely recommend using Michael Hartl's Ruby on Rails Tutorial book. I've also found Daniel Kehoe's Learn Ruby on Rails e-book super helpful as well.

On a personal level, finding a project I actually wanted to build, as opposed to just pacing through a tutorial, is what really helped get me off the ground though.

Ruby strength and usage

Ruby is a scripting language so no it's probably not suitable for "hardware level" code. It's a higher level language than c/c++ and probably the only languages it makes sense to compare it to are perl, python and php.

Of those three I would say it's biggest strength against them is the ruby community. A consensus always forms behind good projects and competing projects either disappear or merge. It's no surprise that ruby is the number 2 language on github (let's face it, everybody has to use javascript at some point.) If you compare a common library like nokogiri to python's offerings you get a community that's split in half between beautiful soup and lxml. For php it's even more drastic. Maybe 8 competing libraries vie for the same space (and every php programmer a cowboy who thinks he can do it better).



Related Topics



Leave a reply



Submit