Ruby - Cool Syntax - Scripting language Ruby

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > Ruby

Ruby - Cool Syntax - Scripting language Ruby

cobaltchloride
Of all the programming languages I have come accross, there is no language which is as fun to use and easy to program in as Ruby.

The iterators in the language and the use of code blocks is just excellent. It takes just an hour or so to get used to the philosphy of Ruby and bang... u can just program anything easily in the language. I strongly recomment it to anyone interested in programming.

e.g.

CODE
1.upto(10) {|x| puts x}


prints numbers from 1 to 10.

CODE
"abcdef".reverse!


reverses the string to fedcba.

Cool smile.gif


Reply

pixelsmack
how about functionality? i mean i haven't used ruby to be honest so i havn't got a massive knowladge on the subject. However it is just a scripting languare (please correct me if i am wrong) and if people want to do simple programming such as what you described a language like VB.net or something would be more handy since it is more intuative and allows more advanced programming when the user feels adept enough.

Reply

cobaltchloride
QUOTE(pixelsmack @ Jan 30 2005, 08:58 PM)
how about functionality? i mean i haven't used ruby to be honest so i havn't got a massive knowladge on the subject. However it is just a scripting languare (please correct me if i am wrong) and if people want to do simple programming such as what you described a language like VB.net or something would be more handy since it is more intuative and allows more advanced programming when the user feels adept enough.
*



You can do with ruby everything you can do with VB.Net etc. It has support to windows API, cool gui (FXRuby), OLE automation, xml parsing etc. There are free libraries available to extend the language. Although Ruby satisfies the definition of a scripting language, it would be gross injustice to label it only a scripting language. It has a full range of object oriented features enabling anyone to write entire applications in the language.

I strongly recommend anyone looking for a perfect programming language to use Ruby. I was very skeptical at first but now I even use it to program excel files instead of VBA.

 

 

 


Reply

avalon
Is this language a web programming language or is it for application software for individual computers like VBA?

I have yet to read about it yet. Can anyone help to provide more information, please?

Thank you.

Reply

cobaltchloride
QUOTE(avalon @ Feb 8 2005, 01:41 PM)
Is this language a web programming language or is it for application software for individual computers like VBA?

I have yet to read about it yet. Can anyone help to provide more information, please?

Thank you.
*




You can find out more information at Ruby Language.

It is an all purpose programming language - for web and desktop applications.

Reply

avalon
Thanks!

I will check it out!

Reply

szupie
QUOTE
Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, and portable.

Oh, I need to mention, it's totally free, which means not only free of charge, but also freedom to use, copy, modify, and distribute it.


Wow, that sounds nice! I shall learn this programming language! cobaltchloride, have you learned C or C++ before? Is Ruby easier than those?

Reply

cobaltchloride
QUOTE(szupie @ Feb 14 2005, 04:26 PM)
Wow, that sounds nice! I shall learn this programming language! cobaltchloride, have you learned C or C++ before? Is Ruby easier than those?
*



No. Trust me, Ruby is a breeze of fresh air. It is very very easy to use. I just dont understand why is it not more popular than it is.

Reply

cobaltchloride
QUOTE(szupie @ Feb 14 2005, 04:26 PM)
Wow, that sounds nice! I shall learn this programming language! cobaltchloride, have you learned C or C++ before? Is Ruby easier than those?
*



No. Ruby is much easier than c or c++. Let me know how u fare in learning it.

Reply

mastercomputers
QUOTE(cobaltchloride @ Feb 27 2005, 03:00 AM)
No. Ruby is much easier than c or c++. Let me know how u fare in learning it.
*



Is Ruby much easier to learn than C/C++?

Well, that depends on how much you already know about those languages. I use Ruby from time to time, but I can't see it replacing my heavy usage of C/C++ programming. It's good for scripting, and can sometimes outperform PERL. The only downfall I guess, is that it wasn't around sooner.

Now I haven't actually encountered any means of compiling it into binary, I just use .rb files filled with scripting commands to perform simple tasks and execute it as if it were a binary file. This method is considered an interpretted language, which is basically scripting but Ruby does claim to be an OOP language and can be compiled I assume.

Just with those commands listed above, you can run Ruby when it's installed by console just by typing ruby, you then do:

CODE
1.upto(10) {|x| puts x}
^D


Should probably explain this code:

The above sets the first number to start from, in this case number 1.upto(10) suggests that it starts at 1 and goes upto 10, we assign it with x, when then print x out with puts in C++ terms:
CODE
for(int x = 1; x <= 10; x++)
   cout << x << endl;



Remember ^D = Ctrl+D and will perform the typed commands and exit when finished.

So the second code will be displayed:

CODE
puts "abcdef".reverse
^D


How we do this in C++, well to make it easier, we'll use the algorithm header file to include the reverse function, but remember there are other ways, and quite possibly more efficient than this method:

CODE
#include <algorithm>
#include <iostream>
using namespace std;
int main(void)
{
   char szString[] = "abcdef";
   reverse(szString, szString + strlen(szString));
   cout << szString << endl;
   return 0;
}


Cheers,


MC

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. ruby language ole - 0.08 hr back. (1)
Similar Topics

Keywords : ruby, cool, syntax, scripting, language, ruby

  1. Ruby, A Good Language To Learn First?
    Should ruby be a first language to learn (14)
  2. Does Astahost Support Ruby Cgi?
    What are the general specifications? (9)
    I was searching this forum to find out if Astahost actually support Ruby. It remains vague to me.
    I found Astahost from clickherefree.com when searching for webhosts featuring Ruby. But on
    Astahost's own page of complete hosting feature, there is no mention of Ruby. Also, on
    free-webhosts.com there is no mention of Ruby under Astahost's description.. Q: Does Astahost
    support Ruby CGI programming? if so, what are the general specifications?....
  3. How Long Have You Been Programming In Ruby?
    Find out how many Ruby programmers here (0)
    Let's find out how many Ruby programmers are there on this forum and how many years experience
    they have.....
  4. The Ruby Language
    Is Ruby a scripting language or not? (4)
    Is Ruby a scripting language? /dry.gif' border='0' style='vertical-align:middle' alt='dry.gif' />
    Personally I think it is a full programming language. When I think of a scripting langauge, I
    think of Perl or JavaScript, Ruby isn't like those, Ruby is a lot more like Java than Perl.
    What do you think?....
  5. Ruby
    "Where everything's an object!" (5)
    I have been a huge fan of Java for a few years now, and recieved a 5 (out of 5) on the AP COmputer
    Science A exam (college level programming, in Java). I signed up for AP Computer Science AB for this
    year, but 7 people signed up so the class was cancelled, so I have signed up for next year. I have
    also read a few books on Java, one of which is the Exam Prep (Exam Cram) review book for the Sun
    Certified Java Prgrammer exam, it looks to me as though I know most of what is tested, but I have
    not memorized the limits for the different primitive types. THat is my background ....

    1. Looking for ruby, cool, syntax, scripting, language, ruby

Searching Video's for ruby, cool, syntax, scripting, language, ruby
advertisement




Ruby - Cool Syntax - Scripting language Ruby



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE