Onde mora a
  produtividade
do Ruby on Rails?

          Fabio Kung
  fabio.kung@caelum.com.br
     fabiokung @ twitter
Scaffold
Ruby
Dinamismo
“Skilled programmers can write
better programmers than they can
              hire”
                      -- Giles Bowkett
Expressividade
Domain Specific Languages
10.days.ago
rufus-scheduler
rufus-scheduler

scheduler.in '20m' do
  puts "go home"
end

scheduler.every '5m' do
  puts "check blood pressure"
end
<div class="listitemchk">
  <h3 class="smller">
    <a href="URL_DO_PERFIL">QUEM_POSTOU</a>:
  </h3>
  <div class="para ">...
<div class="listitemchk">
      <h3 class="smller">
        <a href="URL_DO_PERFIL">QUEM_POSTOU</a>:
      </h3>
      <di...
User.select { |m| m.name == 'jon' && m.age == 21 }

"SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"
User.select { |m| m.name == 'jon' && m.age == 21 }

"SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"




...
class Company < ActiveRecord::Base

  has_many :jobs

  validates_presence_of :name
  validates_presence_of :contact_name
...
Novos paradigmas
Erlang, Scala, ...
YAWS
MapReduce
Enumerable
Ecossistema
TATFT
(Test All The Fucking Time)
TDD

class PostTest < ActiveSupport::TestCase

  def test_title
    post = Post.new :title => "Post 1"
    assert_equal "P...
BDD

class PostTest < ActiveSupport::TestCase

  def test_title_is_required
    post = Post.new
    assert ! post.valid?
 ...
Dúvidas?




                       Obrigado!
fabio.kung@caelum.com.br
    http://fabiokung.com
     twitter: fabiokung
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
Upcoming SlideShare
Loading in...5
×

Onde mora a produtividade do Ruby on Rails?

1,407

Published on

Palestra que aconteceu no evento Mare de Agilidade, em Fortaleza - CE, agosto/2009.

Mas, como sempre, os slides fazem mais sentido para quem esteve na palestra.

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
No Downloads
Views
Total Views
1,407
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
22
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "Onde mora a produtividade do Ruby on Rails?"

  1. 1. Onde mora a produtividade do Ruby on Rails? Fabio Kung fabio.kung@caelum.com.br fabiokung @ twitter
  2. 2. Scaffold
  3. 3. Ruby
  4. 4. Dinamismo
  5. 5. “Skilled programmers can write better programmers than they can hire” -- Giles Bowkett
  6. 6. Expressividade
  7. 7. Domain Specific Languages
  8. 8. 10.days.ago
  9. 9. rufus-scheduler
  10. 10. rufus-scheduler scheduler.in '20m' do puts "go home" end scheduler.every '5m' do puts "check blood pressure" end
  11. 11. <div class="listitemchk"> <h3 class="smller"> <a href="URL_DO_PERFIL">QUEM_POSTOU</a>: </h3> <div class="para "> TEXTO DO RECADO <div class="selr"> ... </div> </div> </div>
  12. 12. <div class="listitemchk"> <h3 class="smller"> <a href="URL_DO_PERFIL">QUEM_POSTOU</a>: </h3> <div class="para "> TEXTO DO RECADO <div class="selr"> ... </div> </div> </div> doc = Hpricot(texto) doc / "div.listitemchk" / "h3.smller" / "a" doc / "div.listitemchk" / "div.para"
  13. 13. User.select { |m| m.name == 'jon' && m.age == 21 } "SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21"
  14. 14. User.select { |m| m.name == 'jon' && m.age == 21 } "SELECT * FROM users WHERE users.name = 'jon' AND users.age = 21" User.select { |u| [1, 2, 3, 4].include? u.id } # SELECT * FROM users WHERE users.id IN (1,2,3,4) User.select { |u| u.friends.name =~ /bi/ } # SELECT * FROM users LEFT OUTER JOIN ... WHERE friends.name ~ 'bi'
  15. 15. class Company < ActiveRecord::Base has_many :jobs validates_presence_of :name validates_presence_of :contact_name validates_presence_of :ddd, :phone validates_uniqueness_of :cnpj validates_uniqueness_of :razao_social validates_numericality_of :ddd, :phone validates_unchangeable :email validates_unchangeable :cnpj acts_as_authentic end
  16. 16. Novos paradigmas
  17. 17. Erlang, Scala, ...
  18. 18. YAWS
  19. 19. MapReduce
  20. 20. Enumerable
  21. 21. Ecossistema
  22. 22. TATFT (Test All The Fucking Time)
  23. 23. TDD class PostTest < ActiveSupport::TestCase def test_title post = Post.new :title => "Post 1" assert_equal "Post 1!", post.title end end
  24. 24. BDD class PostTest < ActiveSupport::TestCase def test_title_is_required post = Post.new assert ! post.valid? end end
  25. 25. Dúvidas? Obrigado! fabio.kung@caelum.com.br http://fabiokung.com twitter: fabiokung

×