SlideShare a Scribd company logo
PHP Vs Ruby CakePHP Vs Ruby On Rails Gautam Rege A brief debate between PHP and Ruby, CakePHP and Rails
About Me Gautam Rege Director @ Josh Software Pvt. Ltd. 9+ years software experience. Rubyist & Entrepreneur  @gautamrege http://gautamrege.wordpress.com Josh Software Ruby On Rails, Ruby On Rails, Ruby On Rails Little bit of J2EE and .NET
Am I out of place?? What will you gain by listening in on the debate between 2 RAD frameworks? Is this about Rails propaganda? Do you have rotten tomatoes to throw? Don't throw shoes and make me famous! ;)
Ruby – Overview Object Oriented Scripting language. Classes, Objects, instance methods etc.  Blocks (yield) Simple 'Duck Typing' using 'responds_to' Mixins Simplicity of single inheritance Power of multiple inhertitance Meta-programming !
Ruby On Rails - Overview Framework built in Ruby (obviously) MVC pattern RESTful  ORM using ActiveRecord Inbuilt Caching  Object Caching Query Caching Fragment Caching
What do we discuss now? PHP Vs Ruby CakePHP Vs Rails What is Ruby and Ruby On Rails?
PHP Vs Ruby Patched Obj. Oriented ?? Reflection & Meta-programing ?? ?? Extremely Popular ! Tons of people Pure Object Oriented Easy to read !! Inherent reflection & meta-programing use Code blocks Gaining popularity Small community
TIOBE Programing Community Index – Jan 2010
Relative Language Popularity over  5, 10, 25 years
Programing Community Index
CakePHP Vs Ruby On Rails CakePHP has been inspired by Ruby On Rails. Modeling, Routing is similar  IDEAL for PHP programmers who Do not have a choice but to use PHP Do not want to learn a new language. Why not try the real thing?
CakePHP Vs Ruby On Rails AppModel Associative Arrays $user['User']['first_name'] Relationships belongs_to has_many has_one  has_and_belongs_to_many 'on the fly' relations bindModel ActiveRecord Ruby Objects @user.first_name Relationships belongs_to has_many has_one  has_many :through => … meta-programing
CakePHP Vs Ruby On Rails AppController AppController set()  method to  access data from controller in a view. ?? html AJAX $ajax->link ActionController ActionView Instance Variables in controller 'magically' available in views. responds_to? | format | html, xml, json, js AJAX link_to_remote
What I found missing in CakePHP aka – Rails rocks! ;) Migrations are missing or not not recommended. Even the tutorials do not use migrations but raw SQL. No mention of deployment.  Guess its a standard Apache + mod_php setup. Use of associative arrays instead of objects $user['user']['first_name'] instead of @user.first_name
What I found missing in CakePHP aka – Rails rocks ! ;)  No support for RESTful routes map.resources :users Provides CRUD for User model /users ( GET | POST ) /users/:id ( GET | DELETE) /users/:id/edit (PUT)
What I found missing in CakePHP aka – Rails rocks ! ;)  There is still a lot of code visible. Lot of configuration  Lot of coding / views etc. etc. DEMONSTRATION of  the Rails way ??
Demonstration - Blog Create a web application for blog posts. A post has a Title and some body text. A post may be published optionally. We should be able to create a post. We should be able to edit a post. We should be able to delete a post. We should be able to list all posts. All information should be stored in database.
Time and Effort Estimate How much  TIME  would you take for this? How many  LINES OF CODE  would you write? Modules: Database configuration Database Schema Logic for posts HTML design Testing
Ruby On Rails I hereby promise that we shall develop  the blog application  WITHOUT TYPING A SINGLE LINE OF CODE in 1 MINUTE.
Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out  Create a post Edit a post
Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out  Create a post Edit a post
Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out  Create a post Edit a post
Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out  Create a post Edit a post
Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out  Create a post Edit a post
Satisfied? Are we ever satisfied? NOW lets add some fancy stuff to this. Lets add some validation A post cannot be created without a title. NOW we do a little bit of coding !!
Satisfied NOW?? No?  Alright! Now you are becoming a programmer! Lets add some UI styles to make it look better Some more 'coding' here!
Thank You! - Shoot me? (with questions only please)

More Related Content

PPTX
Exploring Ruby on Rails and PostgreSQL
PPT
Ruby On Rails Presentation
PDF
What's This React Native Thing I Keep Hearing About?
PPTX
Test Driven Development in CQ5/AEM
PDF
Test Driven Development in AEM/CQ5
PDF
Angular ❤️ CMS from #AngularUp
PDF
React native sharing
PDF
Why use Go for web development?
Exploring Ruby on Rails and PostgreSQL
Ruby On Rails Presentation
What's This React Native Thing I Keep Hearing About?
Test Driven Development in CQ5/AEM
Test Driven Development in AEM/CQ5
Angular ❤️ CMS from #AngularUp
React native sharing
Why use Go for web development?

What's hot (20)

PDF
Building Desktop RIAs With PHP And JavaScript
PDF
Monorepo: React Web & React Native
PDF
Isolated React Js components
PDF
Whats next in templating
ODP
Aloha talk about Performances
PPTX
Creating books app with react native
PDF
Monorepo: React + React Native. React Alicante
PDF
Migrate PHP E-Commerce Site to Go
PDF
Going Native With React
PDF
React Native Workshop - React Alicante
PDF
Introduction to webpack and babel
PDF
OpenValue meetup July 2018 - Angular for Java developers
PDF
Code Nomads meetup June 2018 - Angular for Java developers
PDF
J-Spring 2018 - Angular for Java developers
PDF
A tour of React Native
PDF
Tweakers Developers Summit 2019 - Angular for backend developers
PPTX
Secrets of a Blazor Component Artisan
PDF
How to React Native
PPTX
Introduction to React Native
PPTX
React Native.pptx (2)
Building Desktop RIAs With PHP And JavaScript
Monorepo: React Web & React Native
Isolated React Js components
Whats next in templating
Aloha talk about Performances
Creating books app with react native
Monorepo: React + React Native. React Alicante
Migrate PHP E-Commerce Site to Go
Going Native With React
React Native Workshop - React Alicante
Introduction to webpack and babel
OpenValue meetup July 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developers
A tour of React Native
Tweakers Developers Summit 2019 - Angular for backend developers
Secrets of a Blazor Component Artisan
How to React Native
Introduction to React Native
React Native.pptx (2)
Ad

Similar to Rails Vs CakePHP (20)

KEY
Ruby On Rails
PDF
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
PDF
Why Use Rails by Dr Nic
DOCX
10 reasons to choose CakePHP as Framework
PDF
Rails - getting started
KEY
Why ruby and rails
KEY
Ruby On Rails Overview
KEY
Ruby on Rails survival guide of an aged Java developer
PDF
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
KEY
Intro to Ruby on Rails
PDF
Ror Seminar With agilebd.org on 23 Jan09
PPT
PDF
Ruby and Rails short motivation
PPT
Ruby On Rails Siddhesh
PPT
Introduction to Ruby on Rails
PPT
Ruby On Rails
PDF
Connecting the Worlds of Java and Ruby with JRuby
PDF
遇見 Ruby on Rails
PPT
Ruby On Rails Seminar Basis Softexpo Feb2010
PPTX
Why Ruby?
Ruby On Rails
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
Why Use Rails by Dr Nic
10 reasons to choose CakePHP as Framework
Rails - getting started
Why ruby and rails
Ruby On Rails Overview
Ruby on Rails survival guide of an aged Java developer
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
Intro to Ruby on Rails
Ror Seminar With agilebd.org on 23 Jan09
Ruby and Rails short motivation
Ruby On Rails Siddhesh
Introduction to Ruby on Rails
Ruby On Rails
Connecting the Worlds of Java and Ruby with JRuby
遇見 Ruby on Rails
Ruby On Rails Seminar Basis Softexpo Feb2010
Why Ruby?
Ad

More from Gautam Rege (14)

PDF
RubyConf India 2019 - Confessions of a rubypreneur
PDF
GoFFIng around with Ruby #RubyConfPH
PDF
Agile india 2017 - Rewarding OpenSource with $$$
PDF
WIDS - Gamifying Open Source
PDF
Gamifying Open Source
PDF
Affordable Smart Housing - The new revolution
PDF
WebSummit 2015 - Gopher it
PDF
Dont test your code
PDF
Art of speaking at tech conferences
PDF
RubyConf Portugal 2014 - Why ruby must go!
PDF
Ruby and rails - Advanced Training (Cybage)
PDF
RedDot Ruby Conf 2014 - Dark side of ruby
PDF
ScotRuby - Dark side of ruby
PDF
GCRC 2014 - The Dark Side of Ruby
RubyConf India 2019 - Confessions of a rubypreneur
GoFFIng around with Ruby #RubyConfPH
Agile india 2017 - Rewarding OpenSource with $$$
WIDS - Gamifying Open Source
Gamifying Open Source
Affordable Smart Housing - The new revolution
WebSummit 2015 - Gopher it
Dont test your code
Art of speaking at tech conferences
RubyConf Portugal 2014 - Why ruby must go!
Ruby and rails - Advanced Training (Cybage)
RedDot Ruby Conf 2014 - Dark side of ruby
ScotRuby - Dark side of ruby
GCRC 2014 - The Dark Side of Ruby

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
KodekX | Application Modernization Development
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
cuic standard and advanced reporting.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KodekX | Application Modernization Development
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
cuic standard and advanced reporting.pdf
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf

Rails Vs CakePHP

  • 1. PHP Vs Ruby CakePHP Vs Ruby On Rails Gautam Rege A brief debate between PHP and Ruby, CakePHP and Rails
  • 2. About Me Gautam Rege Director @ Josh Software Pvt. Ltd. 9+ years software experience. Rubyist & Entrepreneur @gautamrege http://gautamrege.wordpress.com Josh Software Ruby On Rails, Ruby On Rails, Ruby On Rails Little bit of J2EE and .NET
  • 3. Am I out of place?? What will you gain by listening in on the debate between 2 RAD frameworks? Is this about Rails propaganda? Do you have rotten tomatoes to throw? Don't throw shoes and make me famous! ;)
  • 4. Ruby – Overview Object Oriented Scripting language. Classes, Objects, instance methods etc. Blocks (yield) Simple 'Duck Typing' using 'responds_to' Mixins Simplicity of single inheritance Power of multiple inhertitance Meta-programming !
  • 5. Ruby On Rails - Overview Framework built in Ruby (obviously) MVC pattern RESTful ORM using ActiveRecord Inbuilt Caching Object Caching Query Caching Fragment Caching
  • 6. What do we discuss now? PHP Vs Ruby CakePHP Vs Rails What is Ruby and Ruby On Rails?
  • 7. PHP Vs Ruby Patched Obj. Oriented ?? Reflection & Meta-programing ?? ?? Extremely Popular ! Tons of people Pure Object Oriented Easy to read !! Inherent reflection & meta-programing use Code blocks Gaining popularity Small community
  • 8. TIOBE Programing Community Index – Jan 2010
  • 9. Relative Language Popularity over 5, 10, 25 years
  • 11. CakePHP Vs Ruby On Rails CakePHP has been inspired by Ruby On Rails. Modeling, Routing is similar IDEAL for PHP programmers who Do not have a choice but to use PHP Do not want to learn a new language. Why not try the real thing?
  • 12. CakePHP Vs Ruby On Rails AppModel Associative Arrays $user['User']['first_name'] Relationships belongs_to has_many has_one has_and_belongs_to_many 'on the fly' relations bindModel ActiveRecord Ruby Objects @user.first_name Relationships belongs_to has_many has_one has_many :through => … meta-programing
  • 13. CakePHP Vs Ruby On Rails AppController AppController set() method to access data from controller in a view. ?? html AJAX $ajax->link ActionController ActionView Instance Variables in controller 'magically' available in views. responds_to? | format | html, xml, json, js AJAX link_to_remote
  • 14. What I found missing in CakePHP aka – Rails rocks! ;) Migrations are missing or not not recommended. Even the tutorials do not use migrations but raw SQL. No mention of deployment. Guess its a standard Apache + mod_php setup. Use of associative arrays instead of objects $user['user']['first_name'] instead of @user.first_name
  • 15. What I found missing in CakePHP aka – Rails rocks ! ;) No support for RESTful routes map.resources :users Provides CRUD for User model /users ( GET | POST ) /users/:id ( GET | DELETE) /users/:id/edit (PUT)
  • 16. What I found missing in CakePHP aka – Rails rocks ! ;) There is still a lot of code visible. Lot of configuration Lot of coding / views etc. etc. DEMONSTRATION of the Rails way ??
  • 17. Demonstration - Blog Create a web application for blog posts. A post has a Title and some body text. A post may be published optionally. We should be able to create a post. We should be able to edit a post. We should be able to delete a post. We should be able to list all posts. All information should be stored in database.
  • 18. Time and Effort Estimate How much TIME would you take for this? How many LINES OF CODE would you write? Modules: Database configuration Database Schema Logic for posts HTML design Testing
  • 19. Ruby On Rails I hereby promise that we shall develop the blog application WITHOUT TYPING A SINGLE LINE OF CODE in 1 MINUTE.
  • 20. Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out Create a post Edit a post
  • 21. Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out Create a post Edit a post
  • 22. Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out Create a post Edit a post
  • 23. Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out Create a post Edit a post
  • 24. Steps Create a rails project Create the “post” scaffold Update the database Start the server Test it out Create a post Edit a post
  • 25. Satisfied? Are we ever satisfied? NOW lets add some fancy stuff to this. Lets add some validation A post cannot be created without a title. NOW we do a little bit of coding !!
  • 26. Satisfied NOW?? No? Alright! Now you are becoming a programmer! Lets add some UI styles to make it look better Some more 'coding' here!
  • 27. Thank You! - Shoot me? (with questions only please)