Ruby/Rails for Python developers, Vitaly Kushner

Get Started. It's Free
or sign up with your email address
Ruby/Rails for Python developers, Vitaly Kushner by Mind Map: Ruby/Rails for Python developers, Vitaly Kushner

1. stuff that doesn't look like code

2. Title

2.1. Ruby Magic

2.1.1. why is it awesome

2.1.1.1. contrary to Python common thinking

3. About

3.1. Founder of Astrails

3.2. Started working with Rails in 2005

3.3. History

3.3.1. started with Python

3.3.2. then due to common language in SysAdmin, moved to Perl

3.3.3. found it better than Python - does the job, & fas to write

3.3.3.1. tho can't understand later

3.3.4. fond of dynamic languages

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

3.3.6. then decided to move to the web

3.3.7. heard about Ruby

3.3.7.1. had a look & didn't like

3.3.8. then, saw the webcast "blog in 5 minutes"

3.3.8.1. decided can't ignore this, must study

3.3.9. since then, in love with the language/technology

4. Magic

4.1. doesn't agree with

4.1.1. explicit is better than implicit

4.1.1.1. if so, write in Java

4.1.1.1.1. Java requires IDE, while dynamic languages can be edited in Notepad without a problem

5. Programming Languages

5.1. Lisp at the top

5.2. Python & Ruby very similar

5.2.1. Ruby is a step ahead of Python

5.3. Erlang better for concurrenct computation

5.4. mentions

5.4.1. Paul Graham's concept of Blah language paradox

5.5. indentation

5.5.1. likes Python's

5.5.2. thinks it created antagonism that hurted adoption

6. Python virtues critique

6.1. Beautiful is better than ugly

6.1.1. Ruby emphasizes more Elegance

6.1.1.1. syntax that reduces clutter

6.1.1.2. makes it closer to natural language

6.2. Explicit is better than implicit

6.2.1. thinks it's wrong

6.2.1.1. "implicit is better than explicit"

6.3. ..

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

6.4.1. Ruby like Perl prefers having many ways

6.4.2. Rails tho says there's a recommended way

6.4.2.1. & it's difficult to do it otherwise

7. Elegance

7.1. close to english as much as possible

8. Monkey patching

8.1. Unlike Python, Ruby allows & encourages it

8.1.1. e.g.

8.1.1.1. 3.megabytes

8.1.1.1.1. => 3145728

8.1.1.2. [audience critique]

8.1.1.2.1. hard to trace where is it implemented

8.1.1.2.2. hard to maintain

8.1.1.3. 10.monthes.from_now

8.1.1.4. 5.minutes.ago.utc

8.2. enables creating beautiful DSL's

8.2.1. useful for readable unit-testing

8.2.1.1. Untitled

9. Blocks

9.1. like lambda but supporting also statements

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

9.3. e.g.

9.3.1. Untitled

9.3.2. x_times(10, lambda {|x| puts x})

9.3.2.1. or using shortcut

9.3.2.1.1. x_times(10) {|x| puts x}

9.4. useful for nested blocks

9.4.1. looks more like configuration file

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

9.5.1. thos less effective - lousy performance

10. DSL's

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

10.2. example

10.2.1. code of Astrails-safe

10.2.1.1. looks like config file

10.2.1.2. indeed very readable

10.2.2. Untitled

11. Method missing

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

11.2. e.g.

11.2.1. User:find_by_company("Astrails")

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

11.3. works by levels

11.4. used daily, to extend objects with methods

11.4.1. creates very readable code

11.5. exists in Python too

11.5.1. taken from SmallTalk

12. gem

12.1. just works

12.2. e.g.

12.2.1. sudo gem install astrails-safe

12.3. repos

12.3.1. Rubyforge

12.3.1.1. 8K gems

12.3.2. GutHub

12.3.2.1. 7K gems

12.3.3. GemCutter

12.3.3.1. same

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

12.5. Python has more libraries

12.5.1. due to legacy

13. Q&A

13.1. What else is written in Ruby besides Rails

13.1.1. Puppet

13.1.2. Micro frameworks

13.1.2.1. Sinatra

13.1.3. Rake

13.1.3.1. like make but in Ruby

13.1.4. Capistrano

13.1.4.1. like fabric

13.1.5. build tools for Java