Ruby definitio

Hi All,

I’m a total newbie in the coding world and have recently started
learning ruby on rails for fun in my spare time. I’m learning by
following the book Agile Web development with Rails.

Now I’ve started wondering “what’s Ruby?”. After a quick search
wikipedia tells me that:

“Ruby is a dynamic, reflective, object-oriented, general-purpose
programming language.”

What?!? Can anyone explain what Ruby is in a lay, simplified, dumbed
down way ? I’ve read each item (reflective, object-oriented, etc) but I
still don’t know what it all mean.

Thanks in advance.

On Fri, Jan 17, 2014 at 2:19 PM, Larissa B. [email protected]
wrote:

wikipedia tells me that:

“Ruby is a dynamic, reflective, object-oriented, general-purpose
programming language.”

What?!? Can anyone explain what Ruby is in a lay, simplified, dumbed
down way ? I’ve read each item (reflective, object-oriented, etc) but I
still don’t know what it all mean.

It means Ruby is a really hot, shiny, language that can be used for
all kinds of things and especially overcoming objections. :slight_smile:
Seriously, those things are CS-ish language-geek terms that a “total
newbie in the coding world” will need some study-time to grok, and you
don’t need to worry about them for now. Maybe when you learn some
other languages, you’ll see how they’re different, and at that time,
we can match up these labels with how the languages differ.

Meanwhile, a brief definition of Ruby is “a great computer language,
in which the Ruby on Rails web-application framework is written.” (I
get the impression your main query was basically “what’s the
difference between ‘Ruby’ and ‘Ruby on Rails’?”)

-Dave

It means Ruby is a really hot, shiny, language that can be used for
all kinds of things and especially overcoming objections. :slight_smile:
Seriously, those things are CS-ish language-geek terms that a “total
newbie in the coding world” will need some study-time to grok, and you
don’t need to worry about them for now. Maybe when you learn some
other languages, you’ll see how they’re different, and at that time,
we can match up these labels with how the languages differ.

Meanwhile, a brief definition of Ruby is “a great computer language,
in which the Ruby on Rails web-application framework is written.” (I
get the impression your main query was basically “what’s the
difference between ‘Ruby’ and ‘Ruby on Rails’?”)

-Dave

Thanks Dave. I’m aware that Ruby is a language and rails is the
framework, I can do some basic coding, I’m not bad in html, php and very
good in CSS but because I’m self-taught I lack the broad overview that
you coding ninjas and masters have. Thus, it’s difficult to simplify the
‘hotness’ of Ruby and understand its attractiveness.

For example, I’m a neuroscientist and could tell you that the brain is
an organ comprised of neuronal and glial cells that use action
potentials to transmit signals. Or it can be simplified to the fact that
the brain is the organ that controls our body and how it interprets and
responds to internal and external stimuli. Or, the short and sweet
version “the brain is our body’s CPU”.

For example, why choose Ruby instead of Python or Perl? Why is Ruby so
hot? And not python? or any other language? I’ve chosen to learn ruby
(on rails) because I was told you can build web apps fast.

L

@Carlos, expressiveness and flexibility have surely helped the concept
become clearer, thanks. One more question: voce e brasileiro? Eu sou :wink:

A neuroscientist? That’s awesome! :smiley:

Why choose Ruby over Python or Perl is open to debate, but it’s
generally
accepted that Ruby’s expressiveness is the simplest answer to that. Its
extreme flexibility allows you to do things like metaprogramming (which
is
the source of much of Rails’ power) and write domain specific languages
very easily. Most of these terms will probably make more sense to you
after
some time using Ruby, as they can be very strange at first.

I work for a Python company in Brazil, but prefer Ruby for my personal
projects. The most noticeable difference between the two is that Python
prefers to be explicit most of the time, while Ruby doesn’t care about
being implicit (this isn’t a rule, just what I usually feel when using
both). So, this could explain why someone would personally prefer one
over
the other.

I hope that helped you a little bit. :slight_smile:


Carlos A.
Software Engineer @ Geekie (geekie.com.br)
+55 11 97320-3878
@carlos_agarie

2014/1/17 Larissa B. [email protected]

Larissa - Ruby is perfectly suitable for artificial intelligence
programming and is influenced by languages used historically in that
context. Since your new consider this task. Open up the ruby repl, a
program named irb, and teach it to do a specific task… something say a
human would do. Programmers like paradigms( like getting their programs
to
make intelligent decision based mechanisms to reduce complex information
into a formal communication protocol like synapses messaging between
cell
like objects) … Now for communicating with other languages python and
perl or even awk and sed can all live happily together sending messages
to
each other much like I’m sending a message to you at this moment. As for
which to use and why can only be decided by the user and their own
experiences with high level languages. But one of the many reasons
Rubyists
enjoy the language is that it is well designed, doesn’t get in the way,
allows us to manipulate it to any specific domain with minimal fuss, and
for the most part just plain fun as hell!

On Fri, Jan 17, 2014 at 11:36 PM, Larissa B. [email protected]
wrote:

For example, why choose Ruby instead of Python or Perl?

Choose Ruby over Perl because Perl’s syntax makes it hard to read and
Perl’s OO barely exists. Perl OTOH has a quite large community and
library of publicly accessible code (CPAN) for almost everything.
Choose Ruby over Python because the syntax is still cleaner (no need
to pass “self” to method calls) and some people feel that Python’s
concept of defining scopes via indentation levels is fragile. There
is even some recent research [1] that supports this view.

Why is Ruby so hot?

There are hypes everywhere. I’d probably care less about “hotness”
and more about whether I like it and can make good use of it. There
are already too many people around following mindlessly what others
say.

And not python?

If you ask a Pythonian you will probably hear that Python is hotter
than Ruby and that Ruby is dying.

or any other language? I’ve chosen to learn ruby
(on rails) because I was told you can build web apps fast.

If it works well for you why bother to chose something else?

Kind regards

robert

[1]
http://synesthesiam.com/posts/what-makes-code-hard-to-understand.html

Simple. Perl gives you nothing that Ruby can not really
offer. Give me a task that I shall do solve and I will
do it in Ruby - with less lines of code, more elegantly
and more robust.

It might be useful to remember that Perl is one of the languages that
inspired the creation of Ruby.

One more question: voce e brasileiro? Eu sou :wink:

Sim, Larissa. Imaginei por causa do nome! :slight_smile:


Carlos A.
Software Engineer @ Geekie (geekie.com.br)
+55 11 97320-3878
@carlos_agarie

2014/1/17 Larissa B. [email protected]

For example, I’m a neuroscientist

I am not a programmer myself, I studied biology and molecular genetics.

I use ruby because it is elegant. I couldn’t care less for “speed” (for
the most part) or any ugly language (I had my time using PHP - those
days are over).

could tell you that the brain is an organ comprised of neuronal
and glial cells that use action potentials to transmit signals.

I see objects and messages.

Ruby is like that :wink:

Or it can be simplified to the fact that the brain is the
organ that controls our body and how it interprets and
responds to internal and external stimuli.

Same analogy with cells. Hormones or other molecules docking
to receptors causing intracellular changes are messages that
change the state of objects. And if you include DNA and RNA,
you suddenly have messages that can permanently change the
behaviour of other objects! Every cell in a multicellular
being is then a mini supercomputer.

I am sure the brain is even more complex due to the
insane amount of dendrites that can have interconnections.

Or, the short and sweet version “the brain is our
body’s CPU”.

Every cell is a mini CPU, think about that. :wink:

For example, why choose Ruby instead of Python or Perl?

Simple. Perl gives you nothing that Ruby can not really
offer. Give me a task that I shall do solve and I will
do it in Ruby - with less lines of code, more elegantly
and more robust.

Python vs. Ruby is harder - the biggest difference is
philosophy. I can not forgive Python that it chose to
go and require explicit self. An OOP language should not
require explicit self. Also, tabs can be annoying -
I dont think a language parser should care about tabs
in such a way as to fail like a drama queen - which
is what the python parser is. A drama queen “oh noooes
me found a little wrongful indent level!!! ME DIES!!!”

The first time I switched to ruby 1.9.x I suddenly saw
warnings in Ruby code about wrongfully indented end’s,
but it was just a warning. For a moment I was shocked
and thought that matz changed ruby to become a drama
queen as well and require TABS now. ;>

Other than that, python has a few strong points.
I think uniformity in code is not so bad - when I
look at other people’s ruby code, I often don’t know
what the f*** I was smoking. And python documentation
is really STILL better than ruby’s documentation -
but it is excused. Because ruby is more elegant,
matz is more awesome than guido, and japanese
hackers only like the japanese language. :wink:

Why is Ruby so hot?

Because it is succinct, terse and elegant.

I am not sure python can be - perhaps.

But perl? Php? Surely not. Those languages are
UGLY. I dont want to stare at ugly code for
hours and hours.

And not python? or any other language?

Python is more elegant than perl. That you
can omit “end” is actually nice especially
for tiny methods - I’d love that, as a togglable
flag for small .rb files …

I’ve chosen to learn ruby (on rails) because
I was told you can build web apps fast.

Perhaps. But there is an initial cost.
You must learn these things… there is no
magic bullet.

I came to ruby before rails and I have to tell
you - rails changed ruby. :frowning:

I am not saying for the worse or to the better,
but things were different. Rails slightly overshadows
parts of ruby, and I think it would be better if
Ruby itself would find more exposure again.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs