20061216 rubyvspython
Upcoming SlideShare
Loading in...5
×
 

20061216 rubyvspython

on

  • 1,561 views

 

Statistics

Views

Total Views
1,561
Views on SlideShare
1,556
Embed Views
5

Actions

Likes
0
Downloads
11
Comments
0

2 Embeds 5

http://www.slideshare.net 4
http://cyberintruder.wordpress.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

20061216 rubyvspython 20061216 rubyvspython Presentation Transcript

  • Why not Ruby? vs. python Wang Yu Hui Porss Inc., Ltd [email_address]
  • 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
  • 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!
  • 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
  • Everything is an object
    • "Hello World!".length
    • -42.abs
    • nil is a regular object
  • 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
  • Ruby Vs. Python
    • http://c2.com/cgi/wiki?PythonVsRuby
    • GUI, Graphics, Web, Libs …
  • Overview
    • HighLevel , GarbageCollected , and DynamicallyTyped
  • 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.
  • 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”
  • Community and Documentation
    • Ruby
      • Rubyforge.org
      • Ruby-lang.org
      • Ruby-doc.org
    • Python
      • CPUG
      • I think ruby community is better and more friendly 
  • 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
  • GUI
    • Ruby
      • Tcl/tk
    • Python
      • Tcl/tk
      • wxPython
      • PyGTK
      • PyQT
      • PySWT
  • Graphics and Images
    • Ruby
      • rmagick
    • Python
      • PIL: Python Imaging Library
      • PyOpenGL
      • Blender
      • matplotlib
      • yapgvb
  • Web Development
    • Ruby
      • Ruby On Rails
    • Python
      • mod python + Apache
      • zope/plone
      • karrigell
      • cherrypy
      • django
      • turbogears
  • 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
  • Websites
    • http://www.37signals.com/
    • http://www.43things.com
    • http:// www.soopie.com
  • Embedded
    • Ruby
      • Ruby for Symbian
    • Python
      • Python for Symbian
  • Lib Install
    • Ruby
      • RubyGems
    • Python
      • Every module has it’s own method
  • Resources
    • Programming Ruby
    • Learning Ruby from an Indian
    • Why Ruby?
    • Ruby-lang.org
    • Ruby-doc.org
    • Rubyforge.org
    • RubyOnRails.org