SlideShare a Scribd company logo
1 of 26
Download to read offline
Test Your Might
                           A Framework Showdown




Monday, October 19, 2009
Symfony Virtuoso                  Rails Ninja

             Brent Shaffer                   Travis Roberts
                 bshaffer@centresource.com    troberts@centresource.com
                    twitter.com/bshaffer       twitter.com/travisroberts




Monday, October 19, 2009
Why Ruby is
                                     Awesome
                           It’s intuitive

                             guesses are usually correct

                           Very readable and concise

                           Chain methods (try that in PHP!)

                       "Hello, world!".reverse.upcase.split.first
                       => "!DLROW"




Monday, October 19, 2009
Why Ruby is
                                       Awesome
                           Everything is an object! (pure OOP)

                     "Hello, world!".reverse
                     => "!dlrow ,olleH"


                     12.5.floor
                     => 12


                     ["e", "b", "d", "c", "a"].sort
                     => ["a", "b", "c", "d", "e"]




Monday, October 19, 2009
Why Ruby is
                                   Awesome
                           Awesome Syntax

                             Method punctuation (is_admin?, delete!)

                             Curly braces not required

                             Optional parenthesis for method calls

                             Instance variables are nothing special

                             Implicit method returns

                             NO SEMICOLONS!!!!


Monday, October 19, 2009
Why Ruby is
                            Awesome




Monday, October 19, 2009
Why Ruby is
                                         Awesome
                             Blocks
                           5.times do |x|
                            puts x * 2
                           end


                           ["1", "2", "3", "4"].each do |x|
                             p x.to_i
                           end


                           10.downto(1) do |x|
                            puts "Number: #{x}"
                           end




Monday, October 19, 2009
Why Ruby is
                                   Awesome
                           Great for scripting

                             maintenance tasks

                             convenience scripts




Monday, October 19, 2009
Why PHP is Awesome

                           Ubiquity
                            PHP jobs vastly outnumber Ruby jobs


                            One-fifth of all open source code being
                            written today is written in PHP.


                            PHP is installed on over 20 million websites
                            and 1 million web servers




Monday, October 19, 2009
Why PHP is Awesome

                           Interpretive Language

                           Great for scripting

                           Evolving

                           Very Active Community




Monday, October 19, 2009
Why PHP is Awesome




                                                            !




                           Data found here in PDF format.




Monday, October 19, 2009
Why PHP is Awesome




                                                            !




                           Data found here in PDF format.


Monday, October 19, 2009
Why PHP is Awesome
                           Built-in Functions

                           C Extensions

                           PECL

                           Anonymous Functions / Namespacing




Monday, October 19, 2009
PHP Syntax
                                    Get Over Yourself
                           PHP                                             Ruby

          $var = new MyClass();                        var = MyClass.new

          $days = range(1, 31);                        days = (1..31).to_a

          $class->each(function($i){ echo $i; });      myclass.each { |i| puts i }

          $hash = array('this' => 'one',               hash = {'this' => 'one',
                         'is' => 'associative');               'is' => 'associative'}

          $arr = array('this', 'is', 'an', 'array');   arr = ['this', 'is', 'an', 'array']

          function is_best_language($lang) {           def best_language?(lang)
            return strtoupper($lang) == 'PHP';           lang.downcase == 'ruby'
          }                                            end




Monday, October 19, 2009
Why PHP is Awesome
                           Coincidence??




Monday, October 19, 2009
Why Rails is
                                   Awesome
                           It uses Ruby!

                           MVC FTW

                           Rails community is awesome




Monday, October 19, 2009
Why Rails is
                                   Awesome
                           RubyGems

                             bundled code libraries

                             rmagick, haml, capistrano, etc.

                           Plugins

                             authlogic, exception notifier, etc.



Monday, October 19, 2009
Why Rails is
                                  Awesome
                           Convention over Configuration

                            it makes logical assumptions

                            db table names, file names, etc.




Monday, October 19, 2009
Why Rails is
                                    Awesome
                           ActiveRecord ORM
                     # get specified records
                     User.all
                     User.first

                     # get all users whose first name is "John"
                     User.all(:conditions => ["name LIKE ?", "John"])

                     # get all users and their related profile record (eager load)
                     User.all(:include => :profile)




Monday, October 19, 2009
Why Rails is
                                   Awesome
                           Query caching - it’s automagic




Monday, October 19, 2009
Why Rails is
                                    Awesome

                           Easy deployment with Capistrano

                           Testing - lots of choices

                             cucumber/rspec, shoulda, test::unit

                           Open-source




Monday, October 19, 2009
Why Symfony is Awesome
                           PHP Web Framework using the MVC Design
                           Pattern

                           Doctrine ORM - based on Hibernate

                           Incorporates concepts from Mojavi (MVC
                           implementation), Rails (routing) and many
                           other open source projects




Monday, October 19, 2009
Why Symfony is Awesome
                           Doctrine ORM
                             // Magic Methods
                             $results = Doctrine::getTable('User')->findAll();

                             // Hydration Methods
                             $results = Doctrine::getTable('User')
                                           ->createQuery()
                                           ->where('count > ?', 2)
                                           ->execute(Doctrine::HYDRATE_ARRAY);

                             // Doctrine 2.0
                             $results = User::findAll();


                           Symfony Components




Monday, October 19, 2009
Why Symfony is Awesome
                           Form Framework

                            Widgets and Validators

                              As complex or simple as you want

                              Easily handles difficult form logic

                            Optionally independent of models




Monday, October 19, 2009
Why Symfony is Awesome
                   Cascading Configurations

                       Project > Application > Module

                       Write your own handlers

                   Philosophy - Less Magic

                   Young Community

                   Quickly Evolving



Monday, October 19, 2009
Monday, October 19, 2009

More Related Content

Recently uploaded

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Test Your Might - Framework Combat

  • 1. Test Your Might A Framework Showdown Monday, October 19, 2009
  • 2. Symfony Virtuoso Rails Ninja Brent Shaffer Travis Roberts bshaffer@centresource.com troberts@centresource.com twitter.com/bshaffer twitter.com/travisroberts Monday, October 19, 2009
  • 3. Why Ruby is Awesome It’s intuitive guesses are usually correct Very readable and concise Chain methods (try that in PHP!) "Hello, world!".reverse.upcase.split.first => "!DLROW" Monday, October 19, 2009
  • 4. Why Ruby is Awesome Everything is an object! (pure OOP) "Hello, world!".reverse => "!dlrow ,olleH" 12.5.floor => 12 ["e", "b", "d", "c", "a"].sort => ["a", "b", "c", "d", "e"] Monday, October 19, 2009
  • 5. Why Ruby is Awesome Awesome Syntax Method punctuation (is_admin?, delete!) Curly braces not required Optional parenthesis for method calls Instance variables are nothing special Implicit method returns NO SEMICOLONS!!!! Monday, October 19, 2009
  • 6. Why Ruby is Awesome Monday, October 19, 2009
  • 7. Why Ruby is Awesome Blocks 5.times do |x| puts x * 2 end ["1", "2", "3", "4"].each do |x| p x.to_i end 10.downto(1) do |x| puts "Number: #{x}" end Monday, October 19, 2009
  • 8. Why Ruby is Awesome Great for scripting maintenance tasks convenience scripts Monday, October 19, 2009
  • 9. Why PHP is Awesome Ubiquity PHP jobs vastly outnumber Ruby jobs One-fifth of all open source code being written today is written in PHP. PHP is installed on over 20 million websites and 1 million web servers Monday, October 19, 2009
  • 10. Why PHP is Awesome Interpretive Language Great for scripting Evolving Very Active Community Monday, October 19, 2009
  • 11. Why PHP is Awesome ! Data found here in PDF format. Monday, October 19, 2009
  • 12. Why PHP is Awesome ! Data found here in PDF format. Monday, October 19, 2009
  • 13. Why PHP is Awesome Built-in Functions C Extensions PECL Anonymous Functions / Namespacing Monday, October 19, 2009
  • 14. PHP Syntax Get Over Yourself PHP Ruby $var = new MyClass(); var = MyClass.new $days = range(1, 31); days = (1..31).to_a $class->each(function($i){ echo $i; }); myclass.each { |i| puts i } $hash = array('this' => 'one', hash = {'this' => 'one', 'is' => 'associative'); 'is' => 'associative'} $arr = array('this', 'is', 'an', 'array'); arr = ['this', 'is', 'an', 'array'] function is_best_language($lang) { def best_language?(lang) return strtoupper($lang) == 'PHP'; lang.downcase == 'ruby' } end Monday, October 19, 2009
  • 15. Why PHP is Awesome Coincidence?? Monday, October 19, 2009
  • 16. Why Rails is Awesome It uses Ruby! MVC FTW Rails community is awesome Monday, October 19, 2009
  • 17. Why Rails is Awesome RubyGems bundled code libraries rmagick, haml, capistrano, etc. Plugins authlogic, exception notifier, etc. Monday, October 19, 2009
  • 18. Why Rails is Awesome Convention over Configuration it makes logical assumptions db table names, file names, etc. Monday, October 19, 2009
  • 19. Why Rails is Awesome ActiveRecord ORM # get specified records User.all User.first # get all users whose first name is "John" User.all(:conditions => ["name LIKE ?", "John"]) # get all users and their related profile record (eager load) User.all(:include => :profile) Monday, October 19, 2009
  • 20. Why Rails is Awesome Query caching - it’s automagic Monday, October 19, 2009
  • 21. Why Rails is Awesome Easy deployment with Capistrano Testing - lots of choices cucumber/rspec, shoulda, test::unit Open-source Monday, October 19, 2009
  • 22. Why Symfony is Awesome PHP Web Framework using the MVC Design Pattern Doctrine ORM - based on Hibernate Incorporates concepts from Mojavi (MVC implementation), Rails (routing) and many other open source projects Monday, October 19, 2009
  • 23. Why Symfony is Awesome Doctrine ORM // Magic Methods $results = Doctrine::getTable('User')->findAll(); // Hydration Methods $results = Doctrine::getTable('User') ->createQuery() ->where('count > ?', 2) ->execute(Doctrine::HYDRATE_ARRAY); // Doctrine 2.0 $results = User::findAll(); Symfony Components Monday, October 19, 2009
  • 24. Why Symfony is Awesome Form Framework Widgets and Validators As complex or simple as you want Easily handles difficult form logic Optionally independent of models Monday, October 19, 2009
  • 25. Why Symfony is Awesome Cascading Configurations Project > Application > Module Write your own handlers Philosophy - Less Magic Young Community Quickly Evolving Monday, October 19, 2009