Create your own awesome maps

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account?
Log In

Ruby/Rails for Python developers, Vitaly Kushner by Mind Map: Ruby/Rails for Python developers, Vitaly Kushner
0.0 stars - reviews range from 0 to 5

Ruby/Rails for Python developers, Vitaly Kushner

stuff that doesn't look like code

Title

Ruby Magic

why is it awesome, contrary to Python common thinking

About

Founder of Astrails

Started working with Rails in 2005

History

started with Python

then due to common language in SysAdmin, moved to Perl

found it better than Python - does the job, & fas to write, tho can't understand later

fond of dynamic languages

searched for companies working in Lisp, couldn't find 1 in israel

then decided to move to the web

heard about Ruby, had a look & didn't like

then, saw the webcast "blog in 5 minutes", decided can't ignore this, must study

since then, in love with the language/technology

Magic

doesn't agree with

explicit is better than implicit, if so, write in Java, Java requires IDE, while dynamic languages can be edited in Notepad without a problem

Programming Languages

Lisp at the top

Python & Ruby very similar

Ruby is a step ahead of Python

Erlang better for concurrenct computation

mentions

Paul Graham's concept of Blah language paradox

indentation

likes Python's

thinks it created antagonism that hurted adoption

Python virtues critique

Beautiful is better than ugly

Ruby emphasizes more Elegance, syntax that reduces clutter, makes it closer to natural language

Explicit is better than implicit

thinks it's wrong, "implicit is better than explicit"

..

There should be 1 & preferrably only 1 way to do it

Ruby like Perl prefers having many ways

Rails tho says there's a recommended way, & it's difficult to do it otherwise

Elegance

close to english as much as possible

Monkey patching

Unlike Python, Ruby allows & encourages it

e.g., 3.megabytes, => 3145728, [audience critique], hard to trace where is it implemented, hard to maintain, 10.monthes.from_now, 5.minutes.ago.utc

enables creating beautiful DSL's

useful for readable unit-testing, Untitled

Blocks

like lambda but supporting also statements

enables creating DSL's that non-programmers can understand & even modify

e.g.

Untitled

x_times(10, lambda {|x| puts x}), or using shortcut, x_times(10) {|x| puts x}

useful for nested blocks

looks more like configuration file

enables functionality similar to macro's e,g, in Lisp

thos less effective - lousy performance

DSL's

not requiring paranthesis, makes the code much less cluttered, & similar to very readable configuration file

example

code of Astrails-safe, looks like config file, indeed very readable

Untitled

Method missing

If method not found, an event occurs that you can implement

e.g.

User:find_by_company("Astrails")

f.flickr.activity.userPhotos('timeframe' => '10d')

works by levels

used daily, to extend objects with methods

creates very readable code

exists in Python too

taken from SmallTalk

gem

just works

e.g.

sudo gem install astrails-safe

repos

Rubyforge, 8K gems

GutHub, 7K gems

GemCutter, same

if you're looking for something, someone probably did it

Python has more libraries

due to legacy

Q&A

What else is written in Ruby besides Rails

Puppet

Micro frameworks, Sinatra

Rake, like make but in Ruby

Capistrano, like fabric

build tools for Java