General Discussions

Ruby looks like a Jewel – CPUFreak91

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
Oh no! A Python hacker is trying out ruby.... and he likes it!

Believe it or not, Ruby is great. Once I learn more of the ropes I may suggest it over Python.

One of my favorite features so far are the looping sequences.

In Python:

a = 0
while a < 10:
print "This is an annoying message"

In Ruby however:


9.times do
print "This is an annoying message"
end

Notice that Ruby doesn't need the colon ( after the looping sequence but it does need the "end" command. This is used in wherever a colon would be used in python.

I can't wait for the July issue of Linux Journal to come out.. their theme for that month is "Ruby".

I'm not putting down Python, it has it's uses, but I think I now have two favorite languages.

BTW, if any of you are interested I've learned loads of ruby stuff because the syntax is so similar to that of python. I'm currently speed reading until some ruby specific code catches my eye.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

[This message has been edited by CPUFreak91 (edited May 22, 2006).]

CoolJ

Member

Posts: 354
From: ny
Registered: 07-11-2004
so do you like it better than python?

strangely enough, my python professor was just telling us about something called Ruby on Rails. How a lot of people are finding it real easy to build websites with.

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
um... DON'T DO IT CPU!!! j/k lol... the 9.times thing, i have a problem with that. it's a set number of times. what if you wanted it to do it a different number of times each time you ran it? then again... maybe it could use a variable... i'll think about checking out Ruby...

edit: dling the installer now...
------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

[This message has been edited by buddboy (edited May 23, 2006).]

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by coolj:
so do you like it better than python?

Not yet... i still haven't found out what I can't do with it yet. I probably won't find out for a long time probably over a year. For instance, I've found some things I don't like about Python (took me 1 year and several months), one of them is its HTML parser.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
lol... HTML parser? hmm...


well, Ruby's cool... i don't like not being able to go into the interpreter and type code. i can go in, but i can't input code to test it out. does it work for you CPU? everything else works fine for me tho.... i like SciTE...

um... i have a question. how do you create a variable? i mean, do you like in python type hello = "hi" or what? cuz i can't figure it out. it always messes it up whenever i try to do stuff...
------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

[This message has been edited by buddboy (edited May 23, 2006).]