Code Genome
C, Java, .NET, Clojure
rails new
rvm & rbenv
dynamic
global variables: $foo
instance/class variables syntax: @foo/@@foo
symbols
blocks: [1,2,3].each { |n| puts n }
open classes OO (easy monkey patching)
mixins
functional: lambda { |foo| foo }
rich collection support with enumerable: all?, any?, collect/map, count, detect/find, inject/reduce, max, min, select and more
args: default, hash, splat
old school but still used
big change
new syntax for chars (?a), json hashes {a: 1}
better lexical scoping, block variable must be local
enumerators: [1,2,3].each
new lambda syntax: -> foo { foo }
tap
keyword args: def foo(bar: 'baz')
refinements like scoped patching (debate, file scoped, scaled back due to perf.)
prepend: more flexible mixins
lazy: [1,2,3].lazy.cycle.map {|x| x * 10}.take(5).to_a
refinements module scoped
rational literal 0.1r
required keyword args: def foo(bar:)
faster & better GC (partial gen.)
shiny
performance
keyword args speedup
GC on symbols
unicode 7
- conventions
- MVC
- migrations
- AR
mature and modular
- strong params
- turbolinks
- russian-doll caching
-
spring
-
variant
respond_to do |format| format.js { render "trash" } format.html.phone { redirect_to progress_path } format.html.none { render "trash" } end
- active job
- async mail
- adequate record (faster db queries)
- web console
editor: Emacs, vi, Sublime
IDE: RubyMine (JetBrains), RadRails (Eclipse)
Capistrano