954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Anyone want to learn Ruby

Hello everyone,

I just started to learn how to program in Ruby. It is a pretty cool language. You can get ruby from www.ruby-lang.org . You can see my code snippets on making widgets using fxRuby (fxRuby is downloaded seperatly from ruby, unless you get the one click installer, which installs everything). But first here is a hello world program written in Ruby:

Hello, World.rb

puts "Hello, World! I am writing in the Ruby programming language"
Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
 

Pure genius Dark!

Here is the same in Python ...

print "Hello, World! I am writing in the Python programming language"

How are your C# efforts coming along?

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

I think I am going to learn python too, I have notice that a lot of people use it.

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
 

I found a good tutorial for ruby at http://www.math.umd.edu/~dcarrera/ruby/0.3/index.html .

Also c# is going pretty good, I got this app dev program on cd that teaches it. It is pretty good language very similar to c++.

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
 

Hi Dark,

beats watching the stupefying TV. Thanks for the Ruby site. Here is an excellent site called the C# school:
http://www.programmersheaven.com/2/Les_CSharp_0

They go really into the fundamentals.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

thanks vegaseat

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
 

Yeah, I wanna learn Ruby and I've started a self-tutorial on it on my blog, using the Sams Teach Yourself In 21 Days book and blogging out a post every day of the three weeks:

http://alabut.com/nonsense/2005/03/learn-ruby-in-3-weeks.html

I'm starting this Sunday, March 22, 2005, but the beauty of the blogosphere is that all the posts will be up forever for anyone else interested. It's building quite a bit of steam and I'm hoping this will be a great resource for anyone that wants to jump into this pool too.

Al Abut
- - -
http://alabut.com
- - -

alabut
Newbie Poster
2 posts since Mar 2005
Reputation Points: 10
Solved Threads: 0
 

Here is the same in Python ...

Code: print "Hello, World! I am writing in the Python programming language"

I know this is from awhile back, but you can use print in ruby and it does the same thing as puts.

Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 23
Solved Threads: 6
 

Seems like a nice laguage. I`m going to try it :p

iwonder
Light Poster
37 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

Pure genius Dark!

Here is the same in Python ...

print "Hello, World! I am writing in the Python programming language"

How are your C# efforts coming along?

Lies! You replaced the word Ruby with Python!

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

Yes, I'll add a few words on RUBY. I saw it referenced a while ago along with hundreds of others. (So much creativity, so little time to learn.)

Recently, it was compared in Infoworld magazine against others for quick AJAX development frameworks and billed as Ruby on Rails. Since the competition was a hundred a seat all the way up to $50,000 to start while Ruby is Open Source, it was a simple choice.

I googled a fabulous tutorial by Chris Pine (as an author, he's smart and doesn't wear your eyes out). It is here: http://pine.fm/LearnToProgram/?Chapter=Contents

RUBY appears to have some incredibly strong structural advantages. It is clearly the product of someone with lots of other language experience. I hate language authors who use crazy new conventions like C++'s COUT and CIN. In Assembler, for example, all operands are right to left, except one and that one makes sense to be left to right. If you know Assembler, you know which one I mean. I thought I'd be settling in with Eiffel but after MS gave them the .NET imprimateur, they jacked their language to $5,000 a seat. Too rich for my blood!

A language needs predictability, which shortens the learning curve and increases the success to mistake ratio. Ruby accomplishes that with simple consistent structure and does it without all of the extra syntax parsing characters that many lazy compiler writers require.

AND did I mention it is Open Source?

If that isn't enough, it appears to be a pure OOL. I had to look up a lot of interesting terms (WIKIPEDIA RULES!) to develop a clear understanding of an OOL construct beyond the current C++ debacle. It was well worth it to find out why "Matz" chose single inheritance instead of multiple but allowed so much other power, e.g. blocks and procs can be passed through methods... WOWWWWW!!!

When I finished Chris's tutorial I had the same "Oh boy, here we go feeling." that I had in 1984 when I finished K&R's book on C. Now look where C is. Every Processor, every platform, most languages, most embedded code and most heavy duty apps. Yikes. Imagine the power of C if K&R had envisioned encapsulation. C++ would have never been born.

So how about it? Is Daniweb ready for Ruby?

tom curren
Junior Poster in Training
Banned
51 posts since Oct 2005
Reputation Points: 11
Solved Threads: 3
 

Hi!

I know this is from awhile back, but you can use print in ruby and it does the same thing as puts.


Nor really ;). Try this

print "not"
puts "the"
p "same"


Regards, mawe

mawe
Junior Poster
133 posts since Sep 2005
Reputation Points: 19
Solved Threads: 58
 

Along comes Boo, looks like Python and Ruby rolled into one, and you can compile it to an executable file, or use it in the shell.

http://boo.codehaus.org/

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

Will give a try, thanks for the website.

reezin14
Junior Poster
107 posts since Jan 2005
Reputation Points: 12
Solved Threads: 4
 

Went to the Boo code snipet here on this site. Downloaded BOO from recomended site and a nice editor/IDE called Boodle (hehe). The snipet works well and seems fun.

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

yes i want to learn ruby,and i am able to create some from also,but i dont know the database connectivity with MySql can anyone help me to connect my apllication to dtabase...plzz

amithasija
Light Poster
44 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

can anybody tell me how to connect to mysql with my application ,i am ne wto ruby on rails,plzz

amithasija
Light Poster
44 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

>>i am ne wto ruby on rails,plzz

what in the world does that mean :eek: :eek: Looks like half English and half Gibberish.

Ancient Dragon
Retired & Loving It
Team Colleague
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

>>i am ne wto ruby on rails,plzz

what in the world does that mean :eek: :eek: Looks like half English and half Gibberish.

converted
i am new to ruby on rails, please

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

Let's stop this right here guys, please.

happygeek
Freelance Word Punk
Administrator
27,471 posts since Mar 2006
Reputation Points: 1,457
Solved Threads: 56
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You