A Rails/Django Comparison by Ben Askins and Alan Green This work is licensed under the Creative Commons Attribution-NonCommercial- ShareAlike 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA. The original version of this presentation is available at http://3columns.net/habitual/docs/Pres2.odp
Discussed: support for model and schema evolution, internationalisation, designer friendly templates, third party plugin support, javascript support and coding flavour. Source:http://www.bright-green.com/blog/2006_12_14/rails_vs_django_paper_and.html
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
A Rails/Django Comparisonby Ben Askins and Alan Green
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/2.5/or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
The original version of this presentation is available at http://3columns.net/habitual/docs/Pres2.odp
Unrepresentative example application:● Too few pages● No Atom/RSS feeds● No public data entry
Development practices:● Didn’t do it the “best way”● Older versions of Rails and Django● Didn’t use this or that helpful third party feature
This was just a single trial. Really need:● Multiple developers● Multiple applications● Multiple environments
“Multiple” means “statistically significant”
LOC and time-to-implement measurements are stupid:
● Not transferable to other developers● Only rough indicator of complexity
Some Data
Plan
$1 000 000
US$1 000 000
Time to Implement
Initial Expectations
“This’ll be easy I’ll whip it up in a weekend.”
“You don’t understand the power of the built-in
admin application.”
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Models Project set up Develop Test data HTML Prototype
TagBook
Reading
Reader n m
nn
11
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Home page Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Basic pages Home page Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Admin pages Basic pages Home page Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Amazon interface Admin pages Basic pages Home page Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Data loading code Amazon interface Admin pages Basic pages Home page Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Test, tidy Data loading code Amazon interface Admin pages Basic pages Home page Models Project set up Develop Test data HTML Prototype
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Test, tidy Data loading code Amazon interface Admin pages Basic pages Home page Models Project set up Develop Test data HTML Prototype
26:46
16:36
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement
Test, tidy Data loading code Amazon interface Admin pages Basic pages Home page Models Project set up Develop Test data HTML Prototype
Admin PagesAdmin Pages26:46
16:36
Rails Django 0.00
5.00
10.00
15.00
20.00
25.00
30.00
Hours to Implement - without Admin
Test, tidy Data loading code Amazon interface Basic pages Home page Models Project set up Develop Test data HTML Prototype
18:21
15:39
Lines of Code
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
Model
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
View/ControllerModel
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
YAML data loading View/ControllerModel
readers.yml
# Reader test dataBen: id: 1 username: benj72 fullname: Ben Askins bio: Eats books for breakfastAlan: id: 2 username: agreen fullname: Alan Green bio: Fond of snakesFred: id: 3 username: fred fullname: Fred Wilkins bio: Loves a good romantic thriller
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
YAML data loading View/ControllerModel
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
Authentication YAML data loading View/ControllerModel
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
Schema Migration Authentication YAML data loading View/ControllerModel
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
HTML Helpers/ Template tags Schema Migration Authentication YAML data loading View/ControllerModel
Rails Django0
100
200
300
400
500
600
700
800
Lines of Code
Templates HTML Helpers/ Template tags Schema Migration Authentication YAML data loading View/ControllerModel
● Hand-coded admin application
● Concise
● Quicker● Slightly less code
Database
Web Server
Routes View
Controller
Model
Browser
Database
Web Server
urls.py Template
View
Model
Browser
Rails Django
Database
Web Server
Routes View
Controller
Model
Browser
Database
Web Server
urls.py Template
View
Model
Browser
Rails Django
ActionController::Routing::Routes.draw do |map|
map.connect '', :controller => "home"
# restful resources map.resources :books do |books| books.resources :readings end map.resources :readers do |readers| readers.resources :reader_images end map.resources :tagsend
● Can save a lot of time● Good looking result● Does simple CRUD quite wellbut...● Only does simple CRUD● Only does simple relationships ● Security not fine-grained ● Not intended for public-facing pages