About Me • Self-learned front-end / back-end / iOS developer • Building web apps since 2001 • Started Singapore PHP User Group in 2006 • Co-founded iOS Dev Scout (2012) • Worked in startups: Foound (2010) and mig33 (2012) • Joined Neo Innovation Inc. in March 2014 4
Its an unfair comparison… • Ruby on Rails in a software framework written in Ruby (a programming language) • PHP is a programming language … or so it thinks… :) • Should compare Ruby vs PHP? • Or Rails vs CakePHP/Symfony/Laravel 6
Ruby • A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write • Created by Yukihiro “Matz” Matsumoto • Public release in 1995 • Currently version 2.1.3 • Ruby on Rails released in 2004 7
PHP • Created in 1994 by Rasmus Lerdorf as a collection of CGI scripts written in C • In 1997, Andi Gutmans and Zeev Suraski of Tel Aviv, Israel started a complete rewrite of the parser - first steps to becoming a real language • Released PHP 3 in 1998 - Changed meaning to “PHP: Hypertext Preprocessor” • Currently version 5.6.2 8
Differences • PHP • Web centric • Not quite a language - collection of functions • Ruby • General purpose (more effort to make web) • An expressive programming language 11
Specifics… 15 class Tea extends Beverages{ private $water private $milk public function __construct(){ $this->water = true; $this->milk = true; } public function is_good(){ return true; } } class Tea < Beverages def initialize @water = true @milk = true end def good? true end private def secret “hello” end end
What I like about Ruby? • Ecosystem • Problems solved by smart people • Tools for developer happyness • Debugging, Testing • Packaging, dependency management • Deployment • Running multiple versions on the same machine 18
What about Rails? • Front-end web application framework • An opinion on how to build a web app • Convention over configuration • MVC • Big on testing • Unit, behaviour, feature 21
What about Rails? • "There's a Gem for that”TM • Problems already solved • Usually drop in solutions with minimal tweaking (defaults are good enough) 23
PHP: We invent the wheel • We have full control & knowledge of how things work • Usually because we had to code it ourselves by hand • Even when you use a framework like CakePHP, Laravel, Symfony… you still have to write a lot of code 24
RoR: We invented Automagic • It works like magic • It works, provides for common use cases & standards • It's usually relatively secure & production ready out of the box • Really lends itself to rapid development, MVP 25
Benefits • Faster ramp-up for building your web app • Commonly used stuff are already build - just add the Gem, configure and go! • From idea to product in short time - and its relatively secure and beta tester ready • Easier deployment options • PaaS - Heroku, Azure • Self host via VPS, shared hosting 27
Benefits • Continuous Integration/Deployment friendly • Easily testable - ensure your product does what its supposed to • Flexible DB options • Easy to Google / StackOverflow for solutions • CLI FTW! 28