Reading Programming

Sep 01, 2005 23:41 # 38553

ginsterbusch *** wants to know...

Introducing myself to Ruby

?% | 1

Hi there,

before I just start out and shift information together which I afterwards have to dump nearly entirely, I'd want to know how to best start into Ruby (and Ruby on Rails, too). I know there are at least two NAOis already working with this programming language: Jaz and Majic, so maybe you could give me some good advices what to read (online tutorials, FAQs, manuals, printed stuff, etc.) and what to avoid (awful written tuts, crappy printed introductions, etc.). :)

Reason for me to learn Ruby:
#1: I simply want to learn another programming language which is a bit more reaching out to different platforms and ways to use it than PHP or other mainly web-based stuff I'm used to code with.

#2: I want to code specific programs for myself which I possibly would want to share with others, which a) are not so platform-specific, so I could use them both on Windows and Linux and b) of course do fit my very specific needs.

#3: And of course it always looks good if you can show the world you're not only working with web-applications and scripts. :D

Thanks in advance,
cu, w0lf.

Fuck off the 30 seconds posting limit!

Sep 02, 2005 01:08 # 38560

majic *** replies...

Re: Introducing myself to Ruby

?% | 1

Well I was reading and using as a reference the pickaxe book.

http://whytheluckystiff.net/ruby/pickaxe/

The Ruby language is amazingly easy to understand and learn. I was doing stuff with it almost immediately, stuff that I never dreamed of doing. Once I got a grasp of the language constructs I moved onto playing with it's C interface so I could extend it in order to allow me to write X Windows code in Ruby. It couldn't have been any easier and Ruby is well documented.

I've been messing with Ruby on Rails off and on for a few months. I would say that the rubyonrails.org website has all the most important information. You can find other stuff on google that people are blogging about.

Maybe we can get a nice Ruby / Ruby on Rails thread going.

Sep 02, 2005 13:41 # 38585

Jaz *** replies...

Ruby tutorial

?% | 1

There is the classic Why's (Poignant) Guide to Ruby. It's from the author who also wrote the tutorial that Frank suggested, but this one has cartoon foxes.

'Yeah, That's what Jesus would do. Jesus would bomb Afghanistan. Yeah.' - snowlion

Sep 05, 2005 08:55 # 38702

Tetrazome ** replies...

Re: Ruby tutorial

*shameless plug* While you're at it try Python too ;)

"Nurture your mind with great thoughts, for you will never go any higher than you think."

Sep 05, 2005 13:43 # 38719

Jaz *** replies...

Re: Ruby tutorial

While you're at it try Python too ;)

Has it tutorials with cartoon foxes? I see.

'Yeah, That's what Jesus would do. Jesus would bomb Afghanistan. Yeah.' - snowlion

Sep 05, 2005 23:22 # 38731

charlie *** replies...

Re: Ruby tutorial

I love the cartoon foxes!

While you're at it try Python too ;)

The great thing about Ruby, is that it's the only truly OO scripting language. I haven't used it very much for real applications, but it is really interesting.

Please contiune to vote AND post.

Sep 11, 2005 15:04 # 38843

Mystilleef * replies...

Re: Ruby tutorial

Python isn't partially OO either. By the way, how does one define a truly OO language?

Sep 11, 2005 17:26 # 38848

charlie *** replies...

Re: Ruby tutorial

?% | 1

The articles I've read say that Ruby was built with OO concepts in mind. (Hence the @@ var declarations etc)

However, in Python, Perl, PHP, etc. OO concepts were kind of an add on at the end.

My acquintence with all these languages is purely academic, so I might be wrong.

Please contiune to vote AND post.

Sep 12, 2005 00:22 # 38857

Mystilleef * replies...

Re: Ruby tutorial

?% | 1

To the best of my knowlegde, Python has always been OO. So much so that functions, classes, strings, methods are objects. To show you just how OO Python is have a look at some output from a Python interpreter.

goldenmyst:(~)$ python
Python 2.4.1 (#1, Sep 11 2005, 16:25:35)
[GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> number = 7
>>> string = "boy"
>>> def print_name(str):
...     print "str"
...
>>> class aClass(object):
...     pass
...
>>> dir(number)
['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__getattribute__', '__getnewargs__', '__hash__', '__hex__', '__init__', '__int__', '__invert__', '__long__', '__lshift__', '__mod__', '__mul__', '__neg__', '__new__', '__nonzero__', '__oct__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdiv__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__str__', '__sub__', '__truediv__', '__xor__']
>>> dir(string)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__str__', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
>>> dir(print_name)
['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__get__', '__getattribute__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc', 'func_globals', 'func_name']
>>> dir(aClass)
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__']

Once again, every type in Python is an object, even functions! Please, if anyone tells you Ruby is more OO than Python is, tell them it is not true.

Having said that, Ruby and Python are great languages worth exploring.

Sep 12, 2005 00:30 # 38858

charlie *** replies...

Re: Ruby tutorial

?% | 1

Well, I guess I was misinformed.

And I guess it doesn't really matter how OO a language is.

...and thanks for being "the voice of reason" Majic.

Please contiune to vote AND post.


Favorites (edit)

Small text Large text

Netalive Amp (Skin for Winamp)