Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

Falling in love with Ruby

Zohar Arad. September 2012

Modern programming languages

Star Wars version

.NET Graduation Ceremony

source: http://deathstarpr.blogspot.co.il/

PHP Hackathon

source: http://www.starwars.com

Python developer, kicking a Java developer's ass

source: http://starwars.wikia.com

Perl Developers Meetup

source: http://starwars.wikia.com

Javascript Developers Debugging IE8

source: http://www.starwars.com/

Ruby Master Class

source: http://www.starwars.com/

Developer Happiness

Coding should be fun

Ruby code is readable, consistent, concise

Ruby

name = "Natalie Portman"
puts "Luke's mom rocks!" unless name.blank?

PHP

$name = "Natalie Portman";
if(strlen($name) > 0){
  echo "Luke's mom rocks";
}
10.times do
  puts "Hi"
end

@credit += 1 if @coins > 2
start_game! unless waiting?

x = 0
until x > 10 do
  x += 1
end

file_content = File.open('somefile.txt','r'){ |f| f.read }

Mixins and Modules

Because multiple-inheritence sucks

Mixins are a cleaner way to reuse code

Functionality is self-contained in modules and mixed into objects

Code is cleaner and more organized.

No inheritence chain to worry about

module Logger
  def log(msg)
    puts msg
  end
end

class Car
  include Logger
  def drive
    log "Driving"
  end
end

Rubygems

Ruby code collaboration eco-system

Rubygems is the driving force of the Ruby

eco-system success

No more missing packages, conflicting versions and broken dependencies

Clear standards and tools for authoring and distribution


Versioning, dependencies and load paths are handled during install

Bundle management with Bundler makes development and deployment a breeze

source 'https://rubygems.org'

gem 'mongoid', '~>3.0'
gem 'rspec', :group => :test
<modelVersion>4.0.0</modelVersion>
<groupId>org.sonatype.mavenbook.simple</groupId>
<artifactId>simple</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>simple</name>
<url>http://maven.apache.org</url>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

Testing as a culture

Reliability on the bleeding edge

Excellent testing frameworks

Public code is always tested - Early adpotion is usually safe


Collaboration is easier - Responsibilities are clear

describe MyController do
  before :each do
    get '/some_url'
  end

  it "should have a response body" do
    last_response.body.should_not be_blank
  end
end

Faster development cycles

It's all about developer performance

Convention over configuration

(so long Java XML files)

Focus on programming rather than making trivial decisions

The right tools for the job (and they're tested)


Variaty is good. Not too much variaty is better!

Ruby made me a better programmer

Coding style and conventions are clear and easy to pick up

Community tools and standards help me focus on the problem rather than menial tasks


For example - Rake, RVM, Bundler

Ruby doesn't get upset when I don't implement an interface or declare types (Java, .NET)

Source: http://www.freshrant.com

Ruby doesn't get upset when I don't want to get my hands dirty (Python)

Source: http://www.redwindsoftware.com

Ruby doesn't get upset when I forget to configure php.ini just right (PHP)

Source: http://kooztop5.blogspot.co.il/

Ruby doesn't get in the way of my code so I can do things faster, more reliably and with less headaches

Thank You!

Questions?