*Ruby's main uses as a code language.
Rails, because you can install Ruby on your server, your clients don't need
to have it. Also, with caching, speed of the app is less important. Also,
people cannot see your source code when it is running on a server. So this
addresses the biggest reservations to Ruby.
*Tools used for coding Ruby
A text editor is sufficient, though there are some IDEs. If you search the
archives, you can find a google doc with an enormous list comparing
different IDEs and editors. I also keep a browser open, and reference the
docs often.
*Ruby's pros and cons
Pros:
* Expressive yet terse syntax. There are some exceptions (File methods, for
example) but Ruby code has a tendency towards beauty, the Ruby community is
also largely dedicated to this.
* Its dynamic nature allows it to support very powerful abstractions. You
probably couldn't have a framework like Rails in a static language.
DataMapper, for example, will look at the state of your code at runtime, and
write SQL to update your database's schema to match. In ActiveRecord, if you
have a database table called "users" and users have an attribute called
"name" then ActiveRecord would give you a method User.find_by_name("Josh")
and it would look in the users table for the record with the name of "Josh".
You get that for free, because that is how your database is structured, you
didn't have to write any code for it. Whats more, in older versions (I don't
think they still do it this way), that method would not even exist until the
first time you called it, then ActiveRecord would go create the method for
you.
* Smalltalk like pure object oriented implementation (everything is an
object), you can say things like 5.times { puts "hello world" }, you can
pass around methods and classes as parameters, operators are objects,
numbers are objects, classes are objects.
* Operator overloading, namespaces, memory management, single inheritance
with mixins, useful built-in classes like regex and hash
* Built-in support for functional programming (Ruby's code blocks, the
source of so much power)
* Structured enough for large apps where purely scripting languages (ie
bash) are not
* It is fun to program in
you will really get excited
* Though it has some problems, rubygems provides a standard interface to
third party gems, making it much easier to find and install libraries that
can provide huge functionality gains (Rails, for example, is acquired
through rubygems)
Cons:
* As a dynamic language, it is slower than static compiled languages, though
JRuby and MRI1.9 have speed on par with other dynamic languages.
* As a dynamic language, your source code is interpreted, which means it
must be present on the computer running it, so if you have proprietary
information in there, then to run your program, people need your code, and
therefore access to your information (it is possible that Rubinius addresses
this with its byte-code system, I'm not sure)
* As a dynamic language, people need the Ruby runtime installed, most
systems do not come with it (Mac does, but its an older version), and most
people are not going to install it. As Joel Spolsky says in regards to
installing the .NET runtime "If we asked our trial users, usually small
organizations and home users, to go through a movie-length installation hell
just to try our app, I think we'd probably lose 95% of them. These are not
customers *yet* (Please Sir May I Have a Linker? – Joel on Software),
they're prospects, and I can't afford to give up 95% of my prospects just to
use a nicer development environment." Perhaps some tools can package it with
your app such that this is not the case, I am pretty sure Shoes does this,
but I'm not sure about that. Static languages don't have to worry about
this, because they get compiled directly to machine code. They also give up
a lot of power through this, though I'm not sure how much is due to being
static, and how much is due to culture. For example, the D programming
language looks like it has addressed a lot of the shortcomings of other
static languages, though at this point it is still unfortunately immature.
Mirah, a language with Ruby syntax that compiles to Java, has got my hopes
up too, though I suppose you could argue about whether JVM languages deserve
to be classified with static languages, and its unfortunately even less
mature than D.
* Green threads (JRuby uses Java's native threads, IDK about the other
implementations)
*Examples of programs coded on Ruby, aside from Rails
Rails isn't really a program (though, I suppose it technically has an
executable -- emasculated though it has been for most of its existence). It
is a framework that you can use, a bunch of libraries and conventions. In
that regard, Puppet for and Metasploit are two well known frameworks
written in Ruby. If you are really wanting programs, then Rails' site (
http://rubyonrails.org/\) gives examples of Twitter, Github, and Yellow Pages
(among others), though that is Rails. My text editor TextMate has
significant portions of it coded in Ruby.
···
On Tue, Sep 28, 2010 at 7:53 AM, Álvaro Bernart <alvaro_bernart@hotmail.com>wrote: