Your SlideShare is downloading. ×
0
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby on Rails 3.1: Let's bring the fun back into web programing

1,486

Published on

The first talk from the "Empower on Rails" Ruby on Rails seminars.

The first talk from the "Empower on Rails" Ruby on Rails seminars.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,486
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. presents Ruby on Rails 3.1Let’s bring the fun back to web programming! Bozhidar Batsov Technical Lead
  • 2. The problem
  • 3. Many programmers arenot particularly happy
  • 4. Its the question that drivesus, Neo. Its the question that brought you here. You know the question, just as I did. What is the question?
  • 5. How can I be be one happy(web) programmer?
  • 6. VS. VS.
  • 7. VS. VS.
  • 8. This PHP code is soclean and elegantlysolves the problem athand. Nobody, Never
  • 9. PHP 0 10 20 30 40 50 60 70 80 90 100 OOP FPPerformance Productivity Fun
  • 10. The Zen of PythonThere should be one –and preferably only one– obvious way to do it.
  • 11. Python 0 10 20 30 40 50 60 70 80 90 100 OOP FPPerformanceProductivity Fun
  • 12. The Web framework for perfectionists with deadlines.
  • 13. 2007
  • 14. A Programmer’s Best Friend
  • 15. The goal of Ruby is to makeprogrammers happy. I started outto make a programming language thatwould make me happy, and as a sideeffect it’s made many, many programmershappy. Especially Webdevelopers. Yukihiro “Matz” Matsumoto, creator of Ruby
  • 16. Ruby 0 10 20 30 40 50 60 70 80 90 100 OOP FPPerformance Productivity Fun
  • 17. PHP Python Ruby 0 10 20 30 40 50 60 70 80 90 100 OOP FPPerformance Productivity Fun
  • 18. Startup Technologies 2011 30 27 24 21 18 15 12 9 6JQuery 3 Django 0 Ruby on Rails
  • 19. http://www.ruby-toolbox.com
  • 20. “Rails is the most well thought-out web development framework I’ve ever used. Andthat’s in a decade of doing web applications fora living. I’ve built my own frameworks, helpeddevelop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before.” James Duncan Davidson, Creator of Tomcat and Ant
  • 21. “Ruby on Rails is a breakthrough in lowering the barriers of entry to programming. Powerful webapplications that formerly might havetaken weeks or months to develop can be produced in a matter of days.” Tim OReilly, Founder of OReilly Media
  • 22. “It is impossible not to notice Ruby on Rails. It has had a huge effect both in and outside the Ruby community...Rails has become a standard to which even well-established tools are comparing themselves to.” Martin Fowler, Author of - Refactoring, PoEAA, XP Explained
  • 23. “Rails is the killer app for Ruby.” Yukihiro Matsumoto, Creator of Ruby
  • 24. Convention overConfiguration
  • 25. DRY (Don’t repeatyourself)
  • 26. Many view (template) options HTML + Erb Haml<div id="profile"> #profile <div class="left column"> .left.column <div id="date"><%= print_date %></div> #date= print_date <div id="address"><%= current_user.address %></div> #address= current_user.address </div> .right.column <div class="right column"> #email= current_user.email <div id="email"><%= current_user.email %></div> #bio= current_user.bio <div id="bio"><%= current_user.bio %></div> </div></div>
  • 27. doctype htmlhtml head title Slim Core Example meta name="keywords" content="template language" body h1 Markup examples div id="content" class="example1" p Nest by indentation == yield - unless items.empty? table - for item in items do tr td = item.name td = item.price - else p | No items found. Please add someinventory. Thank you! div id="footer" | Copyright © 2010 Andrew Stone = render tracking_code javascript: $(content).do_something();
  • 28. Testing in Rails is not optional!
  • 29. All the codeis guilty until proven innocent!
  • 30. DSL FTW
  • 31. ActiveRecordclass Page < ActiveRecord::Base has_many :page_images, :dependent => :destroy validates :title, :presence => true, :uniqueness => true validates :content, :presence => true validates :permalink, :presence => true, :uniqueness => true accepts_nested_attributes_for :page_images, :allow_destroy => true def to_param permalink endend
  • 32. XML Free development: adapter: postgresql database: mycoolproject host: localhost username: mycoolproject password: mycoolproject encoding: utf8 test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000
  • 33. UNIX Certifiedrails g (generate)rails c (console)rails db (dbconsole)rakebundle
  • 34. Agile
  • 35. Innovation
  • 36. Lots offriends
  • 37. Fo r k me on Git Hu b!
  • 38. Fantastic documentationRailsGuides (http://guide.rubyonrails.org)RailsCasts (http://railscasts.org)PragProgRuby on Rails 3 Tutorial (http://ruby.railstutorial.org/)
  • 39. The Dark Art of Deployment
  • 40. In the clouds... ?
  • 41. $ heroku create --stack cedar$ git push heroku master$ heroku open$ heroku scale web=100 worker=50
  • 42. Happy programmers
  • 43. Rails 3.1
  • 44. CoffeeScript# Assignment:number = 42opposite = true# Conditions:number = -42 if opposite# Functions:square = (x) -> x * x# Arrays:list = [1, 2, 3, 4, 5]# Objects:math = root: Math.sqrt square: square cube: (x) -> x * square x# Splats:race = (winner, runners...) -> print winner, runners# Existence:alert "I knew it!" if elvis?# Array comprehensions:cubes = (math.cube num for num in list)
  • 45. JavaScriptvar cubes, list, math, num, number, opposite, race, square;var __slice = Array.prototype.slice;number = 42;opposite = true;if (opposite) number = -42;square = function(x) { return x * x;};list = [1, 2, 3, 4, 5];math = { root: Math.sqrt, square: square, cube: function(x) { return x * square(x); }};race = function() { var runners, winner; winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : []; return print(winner, runners);};if (typeof elvis !== "undefined" && elvis !== null) alert("I knew it!");cubes = (function() { var _i, _len, _results; _results = []; for (_i = 0, _len = list.length; _i < _len; _i++) { num = list[_i]; _results.push(math.cube(num)); } return _results;})();
  • 46. Asset Pipeline
  • 47. SASS$blue: #3bbfce; .content-navigation {$margin: 16px; border-color: #3bbfce; color: #2b9eab;.content-navigation { } border-color: $blue; color: .border { darken($blue, 9%); padding: 8px;} margin: 8px; border-color: #3bbfce;.border { } padding: $margin / 2; margin: $margin / 2; border-color: $blue;}
  • 48. table.hl { table.hl { margin: 2em 0; margin: 2em 0; td.ln { } text-align: right; table.hl td.ln { } text-align: right;} }li { li { font: { font-family: serif; family: serif; font-weight: bold; weight: bold; font-size: 1.2em; size: 1.2em; } }}
  • 49. @mixin table-base { #data { th { float: left; text-align: center; margin-left: 10px; font-weight: bold; } } #data th { td, th {padding: 2px} text-align: center;} font-weight: bold; }@mixin left($dist) { #data td, #data th { float: left; padding: 2px; margin-left: $dist; }}#data { @include left(10px); @include table-base;}
  • 50. .error { .error, .badError { border: 1px #f00; border: 1px #f00; background: #fdd; background: #fdd;} }.error.intrusion { .error.intrusion, font-size: 1.3em; .badError.intrusion font-weight: bold; {} font-size: 1.3em;.badError { font-weight: bold; @extend .error; } border-width: 3px; .badError {} border-width: 3px; }
  • 51. Always in motion the future is...
  • 52. Rails 4.0targeting Ruby 1.9.2expected in an yearit will be the end of the world as we knowit :-)
  • 53. About Bozhidarbozhidar@empowerunited.comhttp://batsov.com@bbatsovhttp://github.com/bbatsov
  • 54. Q&A(any questions?!)
  • 55. Thanks!Don’t leave just yet ;-)
  • 56. you@empowerunited.comfacebook.com/empoweronrails

×