Le 10 principali ragioni per cui Ruby fa pena!
10. Troppo giovane
Nessuna libreria Una collezione di buone librerie, specialmente se organizzate in qualcosa di simile al CPAN del Perl, vuol dire meno lavoro da fare per raggiungere migliori risultati in minor tempo
Librerie Ruby: 108 librerie standard
Ruby Application Archive (RAA) censisce 1800 applicazioni e librerie
RubyForge ospita oltre 9100 progetti
RubyGems ha fornito 118.000.000 di gem
Nessun supporto Documentazione Core documentato al 100%
Documentazione delle librerie standard completa
Disponibilità di tutorial per vari livelli di abilità
Pletora di libri sui vari aspetti di Ruby Community Mailing list in varie lingue
Presenza di gruppi Usenet
Forum Web
Nessuno lo usa Alcune aziende che lo usano HP, Intel, NASA e NOAA Usi di Ruby Simulazione, data munging, generazione di codice, image processing, prototyping, e altro Killer application Ruby on Rails Già usata in applicazioni di successo come Basecamp, Twitter, Slideshare, Vimeo, ...
10. Troppo giovane In anticipo sui tempi!
9. Pressoché impossibile offuscare il codice
Sintassi opzionale Il ; è opzionale
Eliminazione del carattere \n
() opzionali
Sintassi OO obj.attributo  = metodo
Metodi  pericolosi!  e  booleani?
Sintassi semplice e flessibile Semplicità dichiarativa:   local_var = ...
@instance_var = ...
@@class_var = ...
$global_var = ...  do...end  oppure  {...}
Gestione delle eccezioni come in Java
Interpolazione delle stringhe: qualsiasi codice Ruby dentro a  #{...}
Confronto con altri linguaggi Ruby:  puts “Hello world!”
Java:  treRigheMoltoLunghe.speriamoFunzioni...
Perl:  #$<!&;
Lisp:  ((a(((b)))(c)))
9. Pressoché impossibile offuscare il codice Codice pulito!
8. Object Oriented
Ruby è Object Oriented Tutto è oggetto Numeri, blocchi, tutto! Nativamente, non per estensione Non c'è bisogno di mettere ovunque il  self  come in Python
Ruby ha molte facilities Object Oriented Generazione automatica del costruttore (Perl no)
Accessor smart
Definisce metodi di interazione col Core Ruby
Codice procedurale ammesso Si può ignorare la classe  system
Si può mixare e far coesistere oggetti con codice procedurale
8. Object Oriented Troppo flessibile!
7. Uso dei «Mixin»
L'ereditarietà multipla non va bene L'ereditarietà multipla permette a una classe di estendere da più di una sola altra classe. PRO: rende più semplice la modellazione di alberi di oggetti complessi.
CONS: il problema del diamante. Non si possono soddisfare entrambi gli aspetti

Le 10 principali ragioni per cui Ruby fa pena

Editor's Notes

  • #2 A free scripting (or dynamic) language invented by Yukihiro Matsumoto. Similar to Perl, Python, TLC, Lisp, Lua, and more.
  • #3 Ruby 0.95 was posted to the newsgroups in December of 1995. Now 10 years old. Early forms of C where around in the mid-1960s. Almost 50 years old now.
  • #5 Chris Pine’s Learn to Program tutorial is great for beginners. Why’s (Poignant) Guide to Ruby by Why the Lucky Stiff is just a fun romp through Ruby. Facet’s first book is out: Agile Web Development with Rails. The Best of Ruby Quiz is coming soon.
  • #6 Abbreviations: Hewlett-Packard, National Aeronautics and Space Administration, National Oceanic and Atmospheric Administration. Hurricane Katrina image analysis is being done with Ruby. Basecamp is a project and task management web application. Blinksale is a web application for sending and tracking invoices.
  • #10 We will see examples of the attribute methods a little later. (slide 15)
  • #11 We will see examples of variable scope a little later. (slide 15)
  • #14 Inspired by Smalltalk, not Python or Perl.
  • #17 This makes sense: Java’s main is procedural code in disguise.
  • #22 Comparable isn’t actually needed here, since String already implements it.
  • #25 each do ... end is really and iterator, and we’ll talk about that shortly. begin ... end while/until is a syntax trick that isn’t quite equivalent to do { ... } while/until in most languages.
  • #26 Loops work fine for simple arrays, which is their primary use, but what about when we want to start doing custom iteration.
  • #39 This is powerful in prototyping. You can mock-out solutions with basic Ruby objects like String and Array, then gradually replace then with custom objects and specialize behavior. This gets your code running fast, but allows for later customization as development progresses.
  • #42 REXML transformations are easier than XSLT. YAML literally handles persistence with two lines of code: Load and save. Ruby can open web pages and read, just like it opens a file. DRb is similar to CORBA or Java’s RMI, and standard Ruby. WEBrick is Ruby’s Tomcat. Ships with Ruby. SOAP is also included, on top of XML-RPC. ERb makes templating simple and flexible. Similar to JSP style templates, but for any format. RDoc is similar to JavaDoc and can build web documentation, or command-line documentation. Test::Unit uses reflection to make testing trivial.
  • #44 Seriously, most languages are equivalent. They can all be used to do our work. You just need to find what speaks to you. Ruby speaks to me.