Replies To: What is Ruby exactly is it a good language to start out with?

Re: What is Ruby exactly is it a good language to start out with?

Posted 15 October 2009 - 07:24 PM

Ruby is a general-purpose programming language. Ruby is widely used for scripting and web-related tasks, however it's perfectly viable for Desktop applications.

Ruby is an alright first language, however, I'm not sure what to recommend for you to read. Most books on Ruby assume knowledge in at least one programming language previously. However, there are plenty of tutorials around, and if you just google stuff, I'm sure you'll find something to help you out.

As for what you need to download; you'll need the Ruby interpreter. If you're on Windows, just go to http://www.ruby-lang.org, navigate to downloads, and download the Ruby installer. It will install Ruby, RubyGems (I believe), and all other requirements to get you up in running. You can then download NetBeans or Eclipse, or some other IDE for Ruby development. I use Emacs, but that's a little far off for someone new to programming I suppose.

One book you can look at is "The Pickaxe" which is a book called Programming Ruby. You can find the version of the book that was written for Ruby 1.8 (previous version of Ruby) at http://www.rubycentral.com/book/, or you can purchase the 1.9 version from pragprog.

Another book you can look at is "The Ruby Programming Language".

Maybe someone else can fill in the void on books here. I'm not sure if any of the books I mentioned are really suitable for beginners, but they might be. Especially if you're committed.

As a final note. You'll be taken more seriously if you just go ahead and spell out the word 'please' instead of using 'plz'. It's an annoying abbreviation.

Re: What is Ruby exactly is it a good language to start out with?

I was wondering what is ruby and is it a good language to start out with.I just wanted to know the programs i need and where i should go to get started can someone tell me plz?

I am a total beginner and have found the book
"Learn to Program" by Chris Pine
(Second Edition, Published by The Pragmatic Programmers )
to be excellent. It starts with no assumed knowledge and takes you through learning Ruby at a gentle pace.

I have now also bought the Pickaxe book that others have recommended (Programming Ruby: The Pragmatic Programmers' Guide, Second Edition, by Dave Thomas, with Chad Fowler and Andy Hunt) which is probably not good for a first introduction to programming but an excellent second book when you are starting to understand the basics.

Re: What is Ruby exactly is it a good language to start out with?

Ruby is a general purpose object-oriented interpreted scripting language. Like many scripting languages, it is much easier to become acquainted with than compiled languages like C++.

However, for someone new to programming, I really can't recommend Ruby. It's a wonderful language to veteran programmers, but Ruby also contains a lot of obscure static semantics and idioms that are very unique to it, and don't exist in very many other languages, if at all. Many parts of the Ruby language are syntactic sugar added to help experienced and disciplined programmers write more terse and elegant code, however much of these subtleties seem like arbitrary nuances to beginning programmers.

If you're looking to learn programming, I would choose Python over Ruby. Python is a very elegant language, but at the same time its framers are also very strict about making language additions. Python is syntactically very similar to classical programming languages, like C and Java, albeit a lot cleaner, and a lot more modern. It includes a simple development environment (IDLE), so it's as easy as downloading Python, installing, and typing some code into IDLE and hitting F5 to load the code up in the shell.

Much of the craze over Ruby these days comes from the Ruby on Rails framework, which is designed to assist programmers in developing robust web applications easily. While Ruby is used for many other things, it is much less applicable than Python, which sees a much wider array of applications in practice than Ruby. Unfortunately, for the foreseeable future, Ruby will be intrinsically associated with web development.

Re: What is Ruby exactly is it a good language to start out with?

Ruby is a general purpose object-oriented interpreted scripting language. Like many scripting languages, it is much easier to become acquainted with than compiled languages like C++.

However, for someone new to programming, I really can't recommend Ruby. It's a wonderful language to veteran programmers, but Ruby also contains a lot of obscure static semantics and idioms that are very unique to it, and don't exist in very many other languages, if at all. Many parts of the Ruby language are syntactic sugar added to help experienced and disciplined programmers write more terse and elegant code, however much of these subtleties seem like arbitrary nuances to beginning programmers.

If you're looking to learn programming, I would choose Python over Ruby. Python is a very elegant language, but at the same time its framers are also very strict about making language additions. Python is syntactically very similar to classical programming languages, like C and Java, albeit a lot cleaner, and a lot more modern. It includes a simple development environment (IDLE), so it's as easy as downloading Python, installing, and typing some code into IDLE and hitting F5 to load the code up in the shell.

Much of the craze over Ruby these days comes from the Ruby on Rails framework, which is designed to assist programmers in developing robust web applications easily. While Ruby is used for many other things, it is much less applicable than Python, which sees a much wider array of applications in practice than Ruby. Unfortunately, for the foreseeable future, Ruby will be intrinsically associated with web development.

Well, as a start it isn't a scripting language. It's a full fledged programming language, as noted by the wikipedia page. It is indeed compiled as of Ruby 1.9 into YARV bytecode. Python is hardly close to C and Java on the syntax front. There is a huge Ruby community separate from the Rails community. Ruby isn't hard at all to learn, especially with Why's poignant guide still around. Python is still another good choice, but in my opinion Ruby is right up there as well.

Re: What is Ruby exactly is it a good language to start out with?

Posted 11 November 2009 - 02:05 PM

Raynes, on 10 Nov, 2009 - 12:36 PM, said:

Well, as a start it isn't a scripting language. It's a full fledged programming language, as noted by the wikipedia page. It is indeed compiled as of Ruby 1.9 into YARV bytecode. Python is hardly close to C and Java on the syntax front. There is a huge Ruby community separate from the Rails community. Ruby isn't hard at all to learn, especially with Why's poignant guide still around. Python is still another good choice, but in my opinion Ruby is right up there as well.

Ruby is indeed a scripting language, even if its features resemble those of a fully fledged systems language. Don't be quick to assume that calling a language a scripting language is a disparaging term. A scripting language is not necessarily less featured than a systems-level language, and in fact usually contain more features in their standard library (Ruby, Python, PHP all contain a far greater number of useful modules out of the box than, say, C++).

I suppose to be technical, it would be most correct to call Ruby a dynamic langauge--it is rarely used as glue, and in many cases, such as with Rails, is actually used for application programming. However, its source code is interpreted at runtime and it performs on-the-fly computation. Strictly speaking, Ruby is a dynamic scripting language, and involves large amounts of abstraction through its standard library.

The idea that Ruby code is compiled at run-time is a bit of a misconception. The Ruby 1.9 interpreter compiles Ruby source code into bytecode, which is then executed by the Ruby virtual machine, just like Python and PHP. Ruby code, however, is never compiled into machine code, and executes much slower than native compiled code.

If you get past the lack of braces and the usage of indentation in Python code, most of the Python/Pythonic idioms are directly descendant from procedural languages like C. Pythonic design patterns tend to be linear, just like C and C++, where Object-Oriented programming augments a more linear approach.

Ruby on the other hand, has syntactical idioms, semantics, and static semantics that simply don't exist in other languages, and is object-oriented to its core. Look at any of the code you'll see in introductory Ruby tutorials that are designed to "wow" the reader with Ruby's interesting and quirky syntax. These feats are either difficult or impossible to replicate in other programming languages, like Python. This is the difference between Ruby and Python; Ruby likes syntactic sugar, Python likes clean, easily understood, simple code.

My point in suggesting Python to a begging programmer is that Python is much closer to a traditional programming language than Ruby is. Ruby is honestly too quirky to teach to beginners, while Python is much more straightforward. I like Ruby much more than I like Python, but I can't imagine trying to teach its quirks and peculiar design to someone who had never programmed before. Ruby is loaded with ambiguous branching syntax, strange object oriented design patterns, and many of its basic operators perform differently than traditional languages.

Re: What is Ruby exactly is it a good language to start out with?

Posted 12 November 2009 - 01:35 PM

noyesa, on 11 Nov, 2009 - 01:05 PM, said:

Raynes, on 10 Nov, 2009 - 12:36 PM, said:

Well, as a start it isn't a scripting language. It's a full fledged programming language, as noted by the wikipedia page. It is indeed compiled as of Ruby 1.9 into YARV bytecode. Python is hardly close to C and Java on the syntax front. There is a huge Ruby community separate from the Rails community. Ruby isn't hard at all to learn, especially with Why's poignant guide still around. Python is still another good choice, but in my opinion Ruby is right up there as well.

Ruby is indeed a scripting language, even if its features resemble those of a fully fledged systems language. Don't be quick to assume that calling a language a scripting language is a disparaging term. A scripting language is not necessarily less featured than a systems-level language, and in fact usually contain more features in their standard library (Ruby, Python, PHP all contain a far greater number of useful modules out of the box than, say, C++).

I suppose to be technical, it would be most correct to call Ruby a dynamic langauge--it is rarely used as glue, and in many cases, such as with Rails, is actually used for application programming. However, its source code is interpreted at runtime and it performs on-the-fly computation. Strictly speaking, Ruby is a dynamic scripting language, and involves large amounts of abstraction through its standard library.

The idea that Ruby code is compiled at run-time is a bit of a misconception. The Ruby 1.9 interpreter compiles Ruby source code into bytecode, which is then executed by the Ruby virtual machine, just like Python and PHP. Ruby code, however, is never compiled into machine code, and executes much slower than native compiled code.

If you get past the lack of braces and the usage of indentation in Python code, most of the Python/Pythonic idioms are directly descendant from procedural languages like C. Pythonic design patterns tend to be linear, just like C and C++, where Object-Oriented programming augments a more linear approach.

Ruby on the other hand, has syntactical idioms, semantics, and static semantics that simply don't exist in other languages, and is object-oriented to its core. Look at any of the code you'll see in introductory Ruby tutorials that are designed to "wow" the reader with Ruby's interesting and quirky syntax. These feats are either difficult or impossible to replicate in other programming languages, like Python. This is the difference between Ruby and Python; Ruby likes syntactic sugar, Python likes clean, easily understood, simple code.

My point in suggesting Python to a begging programmer is that Python is much closer to a traditional programming language than Ruby is. Ruby is honestly too quirky to teach to beginners, while Python is much more straightforward. I like Ruby much more than I like Python, but I can't imagine trying to teach its quirks and peculiar design to someone who had never programmed before. Ruby is loaded with ambiguous branching syntax, strange object oriented design patterns, and many of its basic operators perform differently than traditional languages.

There is virtually nobody who consider Ruby a scripting language. If you don't believe me, you're welcome to contact the Ruby mailing list, or you could even try to ask Matz himself. I don't think I ever did say it was a systems language, but it's certainly a general purpose programming language.

And no, it isn't a misconception. It's absolutely true. Java is compiled in a highly similar way, and is referred to as a "compiled" language, so I'm not sure how it's a misconception.

And I take the perspective of "If they can't handle this, they might as well not even try to handle that." Ruby is a simple language, whether 'quirky' or not, and as a first language, those 'quirks' would be quite unnoticeable, considering the person is just learning what programming is in the first place. If I had my way, I would teach Haskell and Clojure as first languages for everybody, but that's just me (and some universities).

I'm not trying to argue with you, but most of what you said is your opinion, but doesn't necessarily constitute fact. Same with my opinions. Let's leave this thread be, we can argue over PMs and tea if we need to.

Re: What is Ruby exactly is it a good language to start out with?

Posted 01 December 2009 - 09:50 AM

Java gets precompiled to machine code at runtime(JIT). Ruby, exception to JRuby, can compile to ruby byte code which is interpreted. There are some JITs for Ruby but I don't think any are really ready for showtime(ludicrous).

They are not done in a "similar way."

To the topic: I wouldn't start with Ruby for the reasons already mentioned. Its nifty, powerful, but has some unique things that aren't going to translate to other languages very well. It would be better to start with Python, C#, or Java in my opinion.

This post has been edited by SpeedisaVirus: 01 December 2009 - 09:50 AM

Re: What is Ruby exactly is it a good language to start out with?

If I had my way, I would teach Haskell and Clojure as first languages for everybody, but that's just me (and some universities).

I know this is a fairly old post I'm replying to, but that would probably scare more people away from programming than a language like Python or Java. I am not saying anything against Haskell/Clojure I think they are languages that everyone should learn at some point in their programming career, to mix things up and try something new and a different way of think of things. But from the earliest days of my programming life, when I was first comparing languages and seeing which to learn, functional programming scared me almost as much as assembly, it just didn't make sense. Which is why I picked up Python and C.

</off topic>

I would suggest that you learn both a language such as Java and a scripting/interpreted language such as Ruby or Python on the side.