Your SlideShare is downloading. ×
  • Like
20061216 rubyvspython
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

20061216 rubyvspython

  • 1,220 views
Published

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,220
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
11
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Why not Ruby? vs. python Wang Yu Hui Porss Inc., Ltd [email_address]
  • 2. History and Motivation
    • • Ruby is a programming language developed by Yukihiro
    • Matsumoto (a.k.a. Matz) in 1993
    • It was originally designed to be a better Perl than Perl (that‘s the reason for its name)
    • • It is available on multiple platforms such as Linux, MacOS X,
    • Windows
    • • According to Matz its primary application domains are Text
    • processing, CGI-, Network-, GUI-, XML-programming,
    • Prototyping, Programming education
    • • Ruby has adopted features from languages such as Perl, Lisp,
    • Smalltalk
    • • It is very popular in Asia, especially in Japan
  • 3. What’s Ruby?
    • • Paradigm: Pure OO language
    • • Simple and without surprises: Easy to learn and understand
    • • Potential: Powerful and expressive
    • • Add Ons: Rich library support
    • • Productive: Rapid development
    • • Non commercial: Open Source
    • • Robust: Garbage Collector on Board
    • • Flexible: Untyped, dynamic language
    • • And of course: It‘s cool!
  • 4. Small Example
    • #This is just to show you an example
    • class MyFirstRubyProgram
    • def SayHello(name=“ Cooler “)
    • puts "Hello, #{name}!"
    • end
    • end
    • MyFirstRubyProgram.new.SayHello(“ Benjamin ")
    Comments Define a class Default parameter Define a function
  • 5. Everything is an object
    • "Hello World!".length
    • -42.abs
    • nil is a regular object
  • 6. Regular expressions are well supported
    • s = "Hello World"
    • p s.gsub(/[aeiou]/,“*")
    • H*ll* W*rld
    • t = "11:55:00“
    • if t =~ /dd:dd:dd/
    • then
    • puts "yes"
    • else
    • puts "no"
    • end
    • yes
  • 7. Ruby Vs. Python
    • http://c2.com/cgi/wiki?PythonVsRuby
    • GUI, Graphics, Web, Libs …
  • 8. Overview
    • HighLevel , GarbageCollected , and DynamicallyTyped
  • 9. Heritage and Philosophy
    • Ruby
      • from Smalltalk and Perl
      • EverythingIsAnObject
      • ThereIsMoreThanOneWayToDoIt
    • Python
      • from Algol and Lisp
      • There should be one - and preferably only one - obvious way to do it.
  • 10. Code Style
    • Red/Black Tree Implementation
    • Ruby : http://www.dmh2000.com/cjpr/RBRuby.html
    • Python: http://www.dmh2000.com/cjpr/RBPython.html
    • Python indenting vs. Ruby explicit 'end‘
    • Python requirement for explicit 'self' parameter to methods and instance variable access is very annoying
    • Ruby OO completeness is a win over Python
    • Ruby rescue/ensure vs. Python try/catch/finally
    • Ruby “Syntax error” vs. Python “call stack”
  • 11. Community and Documentation
    • Ruby
      • Rubyforge.org
      • Ruby-lang.org
      • Ruby-doc.org
    • Python
      • CPUG
      • I think ruby community is better and more friendly 
  • 12. Libs
    • Python has better UNICODE support
    • Python's libraries are more plentiful and more mature
    • Ruby, however, can take advantage of Python libraries through the use of Ruby/Python
    • Ruby's API for C integration is much, much cleaner than Python's
  • 13. GUI
    • Ruby
      • Tcl/tk
    • Python
      • Tcl/tk
      • wxPython
      • PyGTK
      • PyQT
      • PySWT
  • 14. Graphics and Images
    • Ruby
      • rmagick
    • Python
      • PIL: Python Imaging Library
      • PyOpenGL
      • Blender
      • matplotlib
      • yapgvb
  • 15. Web Development
    • Ruby
      • Ruby On Rails
    • Python
      • mod python + Apache
      • zope/plone
      • karrigell
      • cherrypy
      • django
      • turbogears
  • 16. Ruby on Rails
    • full-stack, open-source web framework (support structure) in Ruby
    • Creating a weblog in 15 minutes
    • Model-View-Control pattern
    • From theAjax in the view, to the request and response in the controller, to the domain model wrapping the database
    • Web2.0
  • 17. Websites
    • http://www.37signals.com/
    • http://www.43things.com
    • http:// www.soopie.com
  • 18. Embedded
    • Ruby
      • Ruby for Symbian
    • Python
      • Python for Symbian
  • 19. Lib Install
    • Ruby
      • RubyGems
    • Python
      • Every module has it’s own method
  • 20. Resources
    • Programming Ruby
    • Learning Ruby from an Indian
    • Why Ruby?
    • Ruby-lang.org
    • Ruby-doc.org
    • Rubyforge.org
    • RubyOnRails.org