rails_best_practicesflyerhzm@gmail.com Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   1
•         
a.k.a
Richard
Huang    • hDp://huangzhimin.com    • hDp://twiDer.com/flyerhzm    • hDp://github.com/flyerhzm•    ...
rails_best_practices gem•       rails    • 24    •    •            Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   3
rails-bestpractices.com•    • 63    • gem    • gem            Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   4
rails_best_practices gem      Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   5
Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   6
rails•••    Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   7
Java• checkstyle          Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   8
Ruby• Saikuro
‐
• Flog
‐
• Flay
‐
• Reek
‐
                              code
smell            Proprietary
and
Confiden/al....
rails_best_practices gem•      rails       check
list           Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   10
rails_best_practices gem     Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   11
rails_best_practice gem     Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   12
rbp
gem                                sexpProprietary
and
Confiden/al.
©
2010
Aurora
Feint.
sexp       class Post < ActiveRecord::Base         attr_accessor :editable       ends(:class, :Post,  s(:colon2, s(:const,...
sexp       def test         puts "hello world"       ends(:defn, :test, s(:args),  s(:scope,    s(:block,      s(:call, ni...
if i > 10           puts "more than ten"         else           puts "less than or equal to ten"         ends(:if,  s(:cal...
Play with sexp        ruby_parserProprietary
and
Confiden/al.
©
2010
Aurora
Feint.   17
•    • trailing
white
space    • tab
spaces             Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   18
(prepare)•    •                 models    •   model            associa/ons    •   model            aDributes    •         ...
(review)•    •   use
model
virtual
aDribute    •   use
query
aDribute    •   always
add
db
index    •   ......            ...
DemoProprietary
and
Confiden/al.
©
2010
Aurora
Feint.   21
• diaspora
 
github                                              rails•   rails_best_prac/ces                             ...
• rails_best_prac/ces• rails_best_prac/ces
‐‐format
html• rails_best_prac/ces
‐f
html
‐‐with‐textmate• rails_best_prac/ces...
• rails_best_prac/ces
‐g• mvim
config/rails_best_prac/ces.yml         Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   24
How
to
write
your
own
check
list?       Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   25
• rails
best
prac/ces
    hDp://rails‐bestprac/ces.com/
• rails_best_prac/ces    hDps://github.com/flyerhzm/rails_best_prac...
Proprietary
and
Confiden/al.
©
2010
Aurora
Feint.   27
OpenFeint•           mobile
game
social
network
    (   7                 )••• mailto:
hr@openfeint.cn                 Pro...
Upcoming SlideShare
Loading in...5
×

使用Rails best practices做代码审查

2,482

Published on

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

No Downloads
Views
Total Views
2,482
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
14
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 使用Rails best practices做代码审查

    1. 1. rails_best_practicesflyerhzm@gmail.com Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 1
    2. 2. • 
a.k.a
Richard
Huang • hDp://huangzhimin.com • hDp://twiDer.com/flyerhzm • hDp://github.com/flyerhzm• OpenFeint Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 2
    3. 3. rails_best_practices gem• rails • 24 • • Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 3
    4. 4. rails-bestpractices.com• • 63 • gem • gem Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 4
    5. 5. rails_best_practices gem Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 5
    6. 6. Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 6
    7. 7. rails••• Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 7
    8. 8. Java• checkstyle Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 8
    9. 9. Ruby• Saikuro
‐
• Flog
‐
• Flay
‐
• Reek
‐
 code
smell Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 9
    10. 10. rails_best_practices gem• rails check
list Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 10
    11. 11. rails_best_practices gem Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 11
    12. 12. rails_best_practice gem Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 12
    13. 13. rbp
gem sexpProprietary
and
Confiden/al.
©
2010
Aurora
Feint.
    14. 14. sexp class Post < ActiveRecord::Base   attr_accessor :editable ends(:class, :Post,  s(:colon2, s(:const, :ActiveRecord), :Base),  s(:scope,    s(:call, nil, :attr_accessor,      s(:arglist, s(:lit, :editable))    )  )) Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 14
    15. 15. sexp def test   puts "hello world" ends(:defn, :test, s(:args),  s(:scope,    s(:block,      s(:call, nil, :puts,        s(:arglist, s(:str, "hello world"))      )    )  )) Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 15
    16. 16. if i > 10   puts "more than ten" else   puts "less than or equal to ten" ends(:if,  s(:call,    s(:call, nil, :i, s(:arglist)),    :>,    s(:arglist, s(:lit, 10))  ),  s(:call, nil, :puts,    s(:arglist, s(:str, "more than ten"))  ),  s(:call, nil, :puts,    s(:arglist, s(:str, "less than or equal to ten"))  )) Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 16
    17. 17. Play with sexp ruby_parserProprietary
and
Confiden/al.
©
2010
Aurora
Feint. 17
    18. 18. • • trailing
white
space • tab
spaces Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 18
    19. 19. (prepare)• • models • model associa/ons • model aDributes • mailers Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 19
    20. 20. (review)• • use
model
virtual
aDribute • use
query
aDribute • always
add
db
index • ...... Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 20
    21. 21. DemoProprietary
and
Confiden/al.
©
2010
Aurora
Feint. 21
    22. 22. • diaspora
 
github rails• rails_best_prac/ces diaspora Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 22
    23. 23. • rails_best_prac/ces• rails_best_prac/ces
‐‐format
html• rails_best_prac/ces
‐f
html
‐‐with‐textmate• rails_best_prac/ces
‐f
html
‐‐with‐mvim Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 23
    24. 24. • rails_best_prac/ces
‐g• mvim
config/rails_best_prac/ces.yml Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 24
    25. 25. How
to
write
your
own
check
list? Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 25
    26. 26. • rails
best
prac/ces
 hDp://rails‐bestprac/ces.com/
• rails_best_prac/ces hDps://github.com/flyerhzm/rails_best_prac/ces• rails_best_prac/ces hDp://rdoc.rails‐bestprac/ces.com/03/23/11 Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 26
    27. 27. Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 27
    28. 28. OpenFeint• mobile
game
social
network
 ( 7 )••• mailto:
hr@openfeint.cn Proprietary
and
Confiden/al.
©
2010
Aurora
Feint. 28
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×