why use rails by dr nic

Post on 06-May-2015

2.881 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

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

Dr Nic Williams

• 10 000 users

• 3 months

• Re-used their global authentication system

• 600 users of 1500 RailsConf attendees

• First release in 5 days

Websites are just text

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>

Browsers don’t carewhat server you use

Browsers don’t carewhat operating system

Browsers don’t carewhat programming

language

Browsers don’t care.They just want text

Pick what you like best

Developer Real-world problem

Developers are humans

Happy developersdo more good things

Why Rails?

Conventionover

Configuration

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

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

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

DRY

Don’t Repeat Yourself

class Book < ActiveRecord::Baseend

Where are the attributes?Where is the configuration?

Change is instant

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

Why is Rails special?

Ruby(no more Java)

Introspection Open classes Execute code in class definitions

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

ActiveRecordController

HTML helpersAjax

One languagefor everything

Open Source.

http://dev.rubyonrails.org

• 2200 participants

• commiters, patchers, commenters, +1ers

Every application looks the

same

app

models

controllers

views

config

db

test

vendor

Flexibility is overrated

Constraints are liberating

All this creates happiness, plus better applications

Downsides?

Bad architecture is still bad architecture

Its just for websites

Java is evolvingGroovy and Grails, + Open sourced Java

Getting started

• www.rubyonrails.org

• www.peepcode.com - $9 videos

• www.drnicacademy.com - Australian training

top related