Ruby  | |
January 5th, 2003, 06:41 PM
|
#1 (permalink)
| | may contain mild peril
Join Date: Oct 2001 Location: UK
Posts: 3,329
|
Just wondering if anyone has used Ruby ? For those who haven't its an interpreted language and designed to be OO from the ground up (if you like that kind of thing).
I was messing around with it the other day & it has some nice features IMO. Integration of perl style in-line regexps is nice, especially if you do any text processing, and support for iterators is also present. The syntax is really clean, atleast to my eye, and messing around with simple OO stuff wasn't quite as scary as when I messed around with C++ at uni (and certainly cleaner than perls OO support).
The Ruby Application Archive (RAA) offers modules & other code created by the community. I don't expect its as large as Perl's CPAN but its a good start.
If anyone is on the lookout for a new language to learn, wants to play around with some OO stuff or is just bored you could do worse than take a look at Ruby.
Regards
eddy |
| |
January 5th, 2003, 06:56 PM
|
#2 (permalink)
| | Not Really a Member
Join Date: Oct 2001
Posts: 25,385
|
how difficult is file manipulation? (moving/opening/modifying/deleting files)
I do quite a bit of that, so always on the lookout for a good language for that 
Perl its pretty easy to do that stuff, with minimal code
heard of Ruby but never played with it...
I have no idea if I included the ruby interpreter on my RH install  lol
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
|
| |
January 5th, 2003, 07:13 PM
|
#3 (permalink)
| | Member
Join Date: Sep 2002
Posts: 364
|
I couldn't find any info on it for database access. I would be willing to try it out if it has something similar to ease of use as ADO or JDBC. |
| |
January 5th, 2003, 07:24 PM
|
#4 (permalink)
| | may contain mild peril
Join Date: Oct 2001 Location: UK
Posts: 3,329
|
Well I haven't played with any IO beyond STDIN & STDOUT, however simple file access seems easy enough.
As best I can tell you just create a new File object & invoke its new or open method (depending on what you want). Provide the file name & the access you want (read, write etc) & thats about it. Something like; Code: log_file = File.new("logfile.txt", "w")
#Do some other voodoo
log_file.close You also appear to be able to do some cool stuff with iterators & file IO to read by line or byte etc (and I am sure much more).
Thnk I will have a play around with file IO a bit more this evening, seems ok so far though.
Regards
eddy
__________________
I dreamt that a large eagle circled the room three times and then got into bed with me and took all the blankets.
|
| |
January 5th, 2003, 07:31 PM
|
#5 (permalink)
| | may contain mild peril
Join Date: Oct 2001 Location: UK
Posts: 3,329
|
For the database stuff you could take a look at Ruby/DBI or Ruby-ODBC . I am not really into DB stuff so I have no idea how good they are.
Regards
eddy |
| |
January 5th, 2003, 08:50 PM
|
#6 (permalink)
| | Not Really a Member
Join Date: Oct 2001
Posts: 25,385
|
Looks good! Will certainly have to look into it
--- edit ---
It actually looks a little like vbs in some ways... pretty
Last edited by vass0922 : January 5th, 2003 at 09:30 PM.
|
| |
January 6th, 2003, 10:48 PM
|
#7 (permalink)
| | Banned
Join Date: Oct 2001
Posts: 447
|
my $0.02.
Interesting, had not heard of Ruby...
Sounds a little like the java concept, which is already here, generally accepted, works great and is free... Quote: |
Ruby features single inheritance only, *on purpose*. But Ruby knows the concept of modules (called Categories in Objective-C). Modules are collections of methods. Every class can import a module and so gets all its methods for free. Some of us think that this is a much clearer way than multiple inheritance, which is complex, and not used very often compared with single inheritance
| What the heck is "single inheritance"?
Is it only one level of inheritance, or a class can only inherit from, one other class? Versus multiple inheritance in which a class can inherit from more than one class? |
| |
January 6th, 2003, 11:29 PM
|
#8 (permalink)
| | Member
Join Date: Feb 2002
Posts: 161
|
Ruby's single inheritance = each class can only have one parent class. |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |