why use rails by dr nic

33
They Laughed When I Learned Ruby on Rails But When I Started to Build Web Applications... Dr Nic Williams

Upload: dr-nic-williams

Post on 06-May-2015

2.880 views

Category:

Technology


0 download

DESCRIPTION

Ruby on Rails is a leading web development framework, yet is only a few years old. Here's why...

TRANSCRIPT

Page 1: Why Use Rails by  Dr Nic

They Laughed When I Learned Ruby on Rails But When I Started to Build Web Applications...

Dr Nic Williams

Page 2: Why Use Rails by  Dr Nic

• 10 000 users

• 3 months

• Re-used their global authentication system

Page 3: Why Use Rails by  Dr Nic

• 600 users of 1500 RailsConf attendees

• First release in 5 days

Page 4: Why Use Rails by  Dr Nic

Websites are just text

Page 5: Why Use Rails by  Dr Nic

Google homepage<html> <head> <title>Google</title> </head> <body> <img src="/intl/en_ALL/images/logo.gif"> <form action="/search" name=f> <input name=q title="Google Search"> <input name=btnG type=submit value="Google Search"> <input name=btnI type=submit value="I'm Feeling Lucky"> </form> </body></html>

Page 6: Why Use Rails by  Dr Nic

Browsers don’t carewhat server you use

Page 7: Why Use Rails by  Dr Nic

Browsers don’t carewhat operating system

Page 8: Why Use Rails by  Dr Nic

Browsers don’t carewhat programming

language

Page 9: Why Use Rails by  Dr Nic

Browsers don’t care.They just want text

Page 10: Why Use Rails by  Dr Nic

Pick what you like best

Page 11: Why Use Rails by  Dr Nic

Developer Real-world problem

Page 12: Why Use Rails by  Dr Nic

Developers are humans

Page 13: Why Use Rails by  Dr Nic

Happy developersdo more good things

Page 14: Why Use Rails by  Dr Nic

Why Rails?

Page 15: Why Use Rails by  Dr Nic

Conventionover

Configuration

Page 16: Why Use Rails by  Dr Nic

class Book < ActiveRecord::Base validates_presence_of :title has_many :orders belongs_to :author, :class_name => "User"end

Page 17: Why Use Rails by  Dr Nic

class StoreController < ApplicationController def show @book = Book.find_by_permalink(params[:id]) endend

http://mysite.com/store/drnic-book-on-rails

Page 18: Why Use Rails by  Dr Nic

DRY

Don’t Repeat Yourself

Page 19: Why Use Rails by  Dr Nic

class Book < ActiveRecord::Baseend

Where are the attributes?Where is the configuration?

Page 20: Why Use Rails by  Dr Nic

Change is instant

Page 21: Why Use Rails by  Dr Nic

Use it, break it, fix it, trash it, change it

Page 22: Why Use Rails by  Dr Nic

Why is Rails special?

Page 23: Why Use Rails by  Dr Nic

Ruby(no more Java)

Introspection Open classes Execute code in class definitions

Page 24: Why Use Rails by  Dr Nic

#9 popular languagehttp://www.tiobe.com/index.htm?tiobe_index

Page 25: Why Use Rails by  Dr Nic

ActiveRecordController

HTML helpersAjax

One languagefor everything

Page 26: Why Use Rails by  Dr Nic

Open Source.

http://dev.rubyonrails.org

• 2200 participants

• commiters, patchers, commenters, +1ers

Page 27: Why Use Rails by  Dr Nic

Every application looks the

same

app

models

controllers

views

config

db

test

vendor

Page 28: Why Use Rails by  Dr Nic

Flexibility is overrated

Page 29: Why Use Rails by  Dr Nic

Constraints are liberating

Page 30: Why Use Rails by  Dr Nic

All this creates happiness, plus better applications

Page 31: Why Use Rails by  Dr Nic

Downsides?

Page 32: Why Use Rails by  Dr Nic

Bad architecture is still bad architecture

Its just for websites

Java is evolvingGroovy and Grails, + Open sourced Java

Page 33: Why Use Rails by  Dr Nic

Getting started

• www.rubyonrails.org

• www.peepcode.com - $9 videos

• www.drnicacademy.com - Australian training