Archive for the ‘ Ruby Pickaxe ’ Category

Bad News about Ruby

Due to our work in university, we won’t be able to continue our posts on Ruby. That’s the bad news.

The good news however is, that we can instead offer insights into Smalltalk – or more precisely Pharo. You might want to download the one click image and run it as a test. Then, you will understand, that you better read Pharo by Example. Or hear, what we want to say about it.

We like to fully change your project from Ruby to Pharo and because we came up with some good ideas for Ruby and the Pickaxe book we are going to do the exact same thing with Pharo by Example!  Starting with Chapter One called A quick tour of Pharo soon.

cheers zombiecalypse and d3orn

Ruby Project goals

Introducing our Ruby project

We have a few goals in zombiecalypses and mine little Ruby project, which we like to introduce before we begin.

First of all we like to make a summary of each chapter of the Programming Ruby 1.9 book. Because this is not our first language to learn, we have a few important points to pay attention while reading:

  • Important differences to other languages
  • Syntax
  • Specialities and Idioms
  • Why should you therefore use Ruby

The second part will contain a few (at maximum 3) code snippets of this chapter which we are going to explain in detail and which we think are essential or extreme Ruby-like.

Finally, the last part will be a little discussion between zombiecalypse and me. We like to talk about coding stragegy, opinions, conventions and pros&cons.

Since it’s not only reading the chapter but reading, take notes and write blog article you shouldn’t expect an article every two weeks, I would rather say we try to upload an article every month! The exact date will be released with your first article about chapter one and two “Getting Started & Ruby.new”

And at the very end of our project there will be one last article about a little Ruby-exam found in the web. We will try to solve the exam with the help of what we learned by reading the book.

For a more personal goal, we are also trying to create annotations especially a @Test for Ruby. With these two goals we will end our Ruby project.

So stay tuned.

cheers zombiecalypse and d3orn

What is Ruby

Ruby is a general purpose, cross-platform scripting language that was introduced 1995 by Yukihiro Matsumoto (no, I can’t remember that name).

Ruby Logo

copyright © 2006, Yukihiro Matsumoto.

It was inspired by Perl, Smalltalk, Lisp and others. The heritage of Smalltalk gives some nice things:

  • Everything is an object. Of course, this sentense is kind of overused, but it is still nice to know that.
  • Code is an object too. This is cooler, eventhough “everything” should include code, it often does not. In Ruby, you can pass around blocks of code and execute them, whenever you like (and IF you like).

Ruby is very hands on. Don’t mind rules too much, break them, as you go along. Just make things easy to build, and don’t listen too much to folks talking about best practices. Well, there still are conventions, but do with the language, what you want. Sure, you could figure out, how ruby handles input from files, but you could write `cat /path/to/file` much faster.

Also ruby can be used as some kind of glue, as you might use a shell too. As you saw, executing other commands is really trivial, but using C modules seems to be easy as well.

Surely there are the standard features: Object Oriented Programing, Garbage Collection, Regular Expressions, facilities for Unit Tests, … but there is special interest material as well: for example dynamic expansion of objects. That is, you can define your own methods on Integers or only on the integer 1.

Another thing about Ruby is Rails, a platform for the web, so when you are about to create a webpage, you might consider Ruby instead of the mainstream PHP stuff. Of course there are others, but it’s always good to know many languages, when you get around.