Ruby for Perl Programmers

G. Wade Johnson

My Ruby Experience

Dabbled with Ruby a couple of times.

Hired to be a Ruby programmer almost 2.5 years ago.

notes

Differences in Two Acts

notes

Everything is an Object

notes

Simple/Obvious Differences

notes

Structure

Use begin/end or do/end instead of {/}.

Most of the time.

notes

Classes

notes

Modules

notes

Class Example

Open example.rb

notes

Blocks are Major Feature

notes

Containers

Rich set of methods for dealing with each kind of container.

arrays
+, -, [], []=, any?, bsearch, collect, collect!, count, each, first, grep, grep_v, include?, last, map, etc.
hashes
[], []=, any?, default, dig, each_key, each_pair, each_value, empty?, has_key?, has_value?, etc.
enumerables
all?, any?, chunk, count, each_entry, each_with_index, find, include?, member?, etc.
notes

Example Code

Open blocks.rb

notes

Metaprogramming

notes

Gems

notes

Building Projects

notes

Culture/Mindset

Optimize for programmer happiness. is one of their mottos.

I don't find myself particularly happier working in Ruby.

notes

Ruby on Rails

Most seem to program in Ruby on Rails not in Ruby.

They also don't seem to recognize that fact.

Rails (libraries) extend Ruby in a lot of ways; often by monkey-patching standard classes.

notes

Speed

They realize that Ruby is not the fastest runtime around and are mostly okay with it.

notes

Neophiles

Many in the Ruby community seem attracted to new stuff.

notes

Reminds Me of Perl From a Few Years Ago

notes

Two main figures in the community.

notes

Comparison to Perl

In many ways, they look down on Perl, while realizing that Ruby was influenced by Perl.

Mostly not as hostile as the Java community.

notes

Some Really Bright People

notes

Best Practices?

notes

Convention over Configuration

notes

Questions?

notes