Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Test Your Might - Framework Combat
1. Test Your Might
A Framework Showdown
Monday, October 19, 2009
2. Symfony Virtuoso Rails Ninja
Brent Shaffer Travis Roberts
bshaffer@centresource.com troberts@centresource.com
twitter.com/bshaffer twitter.com/travisroberts
Monday, October 19, 2009
3. Why Ruby is
Awesome
It’s intuitive
guesses are usually correct
Very readable and concise
Chain methods (try that in PHP!)
"Hello, world!".reverse.upcase.split.first
=> "!DLROW"
Monday, October 19, 2009
4. Why Ruby is
Awesome
Everything is an object! (pure OOP)
"Hello, world!".reverse
=> "!dlrow ,olleH"
12.5.floor
=> 12
["e", "b", "d", "c", "a"].sort
=> ["a", "b", "c", "d", "e"]
Monday, October 19, 2009
5. Why Ruby is
Awesome
Awesome Syntax
Method punctuation (is_admin?, delete!)
Curly braces not required
Optional parenthesis for method calls
Instance variables are nothing special
Implicit method returns
NO SEMICOLONS!!!!
Monday, October 19, 2009
7. Why Ruby is
Awesome
Blocks
5.times do |x|
puts x * 2
end
["1", "2", "3", "4"].each do |x|
p x.to_i
end
10.downto(1) do |x|
puts "Number: #{x}"
end
Monday, October 19, 2009
8. Why Ruby is
Awesome
Great for scripting
maintenance tasks
convenience scripts
Monday, October 19, 2009
9. Why PHP is Awesome
Ubiquity
PHP jobs vastly outnumber Ruby jobs
One-fifth of all open source code being
written today is written in PHP.
PHP is installed on over 20 million websites
and 1 million web servers
Monday, October 19, 2009
10. Why PHP is Awesome
Interpretive Language
Great for scripting
Evolving
Very Active Community
Monday, October 19, 2009
11. Why PHP is Awesome
!
Data found here in PDF format.
Monday, October 19, 2009
12. Why PHP is Awesome
!
Data found here in PDF format.
Monday, October 19, 2009
13. Why PHP is Awesome
Built-in Functions
C Extensions
PECL
Anonymous Functions / Namespacing
Monday, October 19, 2009
14. PHP Syntax
Get Over Yourself
PHP Ruby
$var = new MyClass(); var = MyClass.new
$days = range(1, 31); days = (1..31).to_a
$class->each(function($i){ echo $i; }); myclass.each { |i| puts i }
$hash = array('this' => 'one', hash = {'this' => 'one',
'is' => 'associative'); 'is' => 'associative'}
$arr = array('this', 'is', 'an', 'array'); arr = ['this', 'is', 'an', 'array']
function is_best_language($lang) { def best_language?(lang)
return strtoupper($lang) == 'PHP'; lang.downcase == 'ruby'
} end
Monday, October 19, 2009
15. Why PHP is Awesome
Coincidence??
Monday, October 19, 2009
16. Why Rails is
Awesome
It uses Ruby!
MVC FTW
Rails community is awesome
Monday, October 19, 2009
17. Why Rails is
Awesome
RubyGems
bundled code libraries
rmagick, haml, capistrano, etc.
Plugins
authlogic, exception notifier, etc.
Monday, October 19, 2009
18. Why Rails is
Awesome
Convention over Configuration
it makes logical assumptions
db table names, file names, etc.
Monday, October 19, 2009
19. Why Rails is
Awesome
ActiveRecord ORM
# get specified records
User.all
User.first
# get all users whose first name is "John"
User.all(:conditions => ["name LIKE ?", "John"])
# get all users and their related profile record (eager load)
User.all(:include => :profile)
Monday, October 19, 2009
20. Why Rails is
Awesome
Query caching - it’s automagic
Monday, October 19, 2009
21. Why Rails is
Awesome
Easy deployment with Capistrano
Testing - lots of choices
cucumber/rspec, shoulda, test::unit
Open-source
Monday, October 19, 2009
22. Why Symfony is Awesome
PHP Web Framework using the MVC Design
Pattern
Doctrine ORM - based on Hibernate
Incorporates concepts from Mojavi (MVC
implementation), Rails (routing) and many
other open source projects
Monday, October 19, 2009
24. Why Symfony is Awesome
Form Framework
Widgets and Validators
As complex or simple as you want
Easily handles difficult form logic
Optionally independent of models
Monday, October 19, 2009
25. Why Symfony is Awesome
Cascading Configurations
Project > Application > Module
Write your own handlers
Philosophy - Less Magic
Young Community
Quickly Evolving
Monday, October 19, 2009