[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby, brother of VB?

Mike Cox

3/21/2005 2:24:00 AM

Hi. I am researching a language to switch to after Microsoft EOL'd classic
Visual Basic. Visual Basic.NET is nothing like the old VB. Having been
burned by relying on a commercial vendor, I am on a quest to find a VB like
language that is free from corporate whims. I went on a computer language
site that documented the history of computer languages and their lineage.

It was quite a shock to learn that Ruby may possibly be the brother of VB,
and that Ruby is the son of Algol 60. Just a cursery glance over Ruby
confirmed that my beloved "begin" and "end" are there. Sharing the same
genes as a Algol is quite a statement of pedigree. No wonder 60 percent of
all programers speak VB to their computers. And now, my fellow Algol 60
decendants, I am now close to making Ruby my langauge of choice. My
langauge, VB, is dying a cruel cancer of corporate apathy, but now I have
found its brother so I am rejoicing.

So my question is, what do I need to know to get started from a VB
background?

P.S. Here's the link to the comp. lang lineage chart:
http://www.levenez.com/lang/hi...


15 Answers

ptkwt

3/21/2005 2:59:00 AM

0

In article <3a6pkoF69qdjpU1@individual.net>,
Mike Cox <mikecoxlinux@yahoo.com> wrote:
>Hi. I am researching a language to switch to after Microsoft EOL'd classic
>Visual Basic. Visual Basic.NET is nothing like the old VB. Having been
>burned by relying on a commercial vendor, I am on a quest to find a VB like
>language that is free from corporate whims.

Well, I wouldn't call Ruby (the Ruby we all speak around these here c.l.r
parts) VB-like (some might call them fight'n words). But it is free
from corporate whims.

>I went on a computer language
>site that documented the history of computer languages and their lineage.
>
>It was quite a shock to learn that Ruby may possibly be the brother of VB,

There was apparently a language which was the precursor to VB which
was called Ruby. That Ruby became VB, however that other Ruby has
nothing to do with the Ruby we're dealing with here on this
newsgroup/mailing list. Actually, about a year ago one of the creators
of that other Ruby (Mike Geary) was hanging out here on c.l.r (I think
he even made the 100,000th post). If he is
still lurking, perhaps he can offer more info on that other Ruby.

>and that Ruby is the son of Algol 60. Just a cursery glance over Ruby
>confirmed that my beloved "begin" and "end" are there. Sharing the same
>genes as a Algol is quite a statement of pedigree.

Well, lots of languages came out of the Algol branch of the
computer language family tree.

>No wonder 60 percent of
>all programers speak VB to their computers. And now, my fellow Algol 60
>decendants, I am now close to making Ruby my langauge of choice. My
>langauge, VB, is dying a cruel cancer of corporate apathy, but now I have
>found its brother so I am rejoicing.
>
>So my question is, what do I need to know to get started from a VB
>background?

Having never coded in VB, I'm not sure I'm qualified to point you in the
right direction, however, I would start by getting a copy of Dave Thomas'
"Programming Ruby" 2nd edition. I suspect you'll find that Ruby is very
different from VB, but if you stick with it I suspect you'll be
pleasantly surprised and you'll probably learn a lot.

Phil

James Britt

3/21/2005 3:52:00 AM

0

Mike Cox wrote:
> ...
> So my question is, what do I need to know to get started from a VB
> background?

Forget all the VB you've ever learned. Really. I was a VB hacker for
some time. I liked it, it paid the rent, got me published. But habits
acquired using VB will get in the way of using Ruby.

There are essential aspects to Ruby that don't really have a counterpart
in VB. Certainly the approach to OO programming in VB is, um, quite
different than in Ruby.

As others have mentioned, go read Programming Ruby by Dave Thomas. But
also try to find a good book that explains object-oriented programming;
perhaps Designing Object-Oriented Software, by Rebecca Wirfs-Brock.

(I'd be leery of books that focused too much on Java or C#, as they have
their own OO quirks that might impede grokking Ruby goodness.)

And read a lot of Ruby code. Maybe start with the Weekly Ruby Quiz
(posted to this list). See if you can figure out what are doing. Ask
questions. Stick around.

>
> P.S. Here's the link to the comp. lang lineage chart:
> http://www.levenez.com/lang/hi...

Means nothing, really, as it does not indicate just what was borrowed
and to what degree.

James
--

http://www.ru...
http://www.r...
http://catapult.rub...
http://orbjson.rub...
http://ooo4r.rub...
http://www.jame...


vruz

3/21/2005 4:06:00 AM

0

[sinp all good stuff]
> So my question is, what do I need to know to get started from a VB
> background?
> P.S. Here's the link to the comp. lang lineage chart:
> http://www.levenez.com/lang/hi...

Not sure of the resemblance with Algol, but no doubt there will be a
number of differences between VB and Ruby to get started with.

There are certain things you get with Ruby that you didn't have with
VB, and viceversa.

Bad news first:
* None of the Ruby IDEs available out there resemble to the VB IDE
* You can't create OCX/ActiveX components with Ruby
* The current implementation of Ruby doesn't compile to bytecode or
native executable binary

On the other hand, the good news are really great, and I think they
greatly outnumber the disadvantages
* You get a beautiful and very clean language that doesn't get in the way.
* You usually end up having more time to think about your code, and
you end up writing less due to Ruby's expresiveness.
* There's a great number of libraries available from everything (GUI,
database, web development, graphics, and a large etcetera)
* Ruby is cross-platform and runs wonderfully on unices and Linux as
well as Windows and other platforms.
* On Windows, you can have access to the full array of niceties that
come with the platform. ( COM objects, GUI, Windows API, Services,
etc. etc.)
* It's free !! Free of charge, and free for you to read, learn and
use the source code of Ruby itself (ever wished fixing any of the
bugs inside VB ?)
* Rubyscript2exe can pack your ruby programs inside of a regular .EXE
for deployment
* No Microsoft, no discontinuation of products


To get started with all this on Windows you need 3 things:

* Windows 2000, Windows XP, 2003 or newer (Ruby will work on older
versions of Windows, but the full array of possibilities is better
exploited in the newest

* One-click Ruby Installer downloadable from
http://rubyforge.org/frs/download.php/2407/ruby...

* Optionally, a set of useful libraries for Win32 development:
http://rubyforge.org/frs/download.php/3473/win32utils-V...

I think most Ruby coders will agree that the best way to get started
is having a look at "Programming Ruby"

( 1st edition downloadable from:
http://www.bdelmee.easynet.be/ruby/pr0... Windows CHM format,
http://phrogz.net/Progra... Phrogz' annotated PR online,
http://www.ruby-doc.org/downloads/palm/plucker/Programmi...
Palm Plucker format)

or buy the 2nd. updated and corrected edition that covers Ruby 1.8.x
http://pragmaticprogrammer.com/titles/ruby/...

Also highly recommendable "The Ruby Way" by Hal Fulton
http://www.amazon.com/exec/obidos/ASIN/0672320835/002-75264...

Finally, if you're up to a non-traditional approach to technical
writing, not faint hearted and able to appreciate one of the best
things in life is "chunky bacon", there's "Why's (Poignant) Guide to
Ruby" here:
http://poignantguide...
by our fellow rubyist self baptised Why The Lucky Stiff.

Happy coding !

vruz


Dave Burt

3/21/2005 4:08:00 AM

0


"Phil Tomson" <ptkwt@aracnet.com> answered:
>Mike Cox <mikecoxlinux@yahoo.com> wrote:
>>Hi. I am researching a language to switch to after Microsoft EOL'd
>>classic
>>Visual Basic. Visual Basic.NET is nothing like the old VB. Having been
>>burned by relying on a commercial vendor, I am on a quest to find a VB
>>like
>>language that is free from corporate whims.
>
> Well, I wouldn't call Ruby (the Ruby we all speak around these here c.l.r
> parts) VB-like (some might call them fight'n words). But it is free
> from corporate whims.

I have been noticing recently, writing both VB and Ruby, that they do often
look alike (ever so clean and beautiful), but, I think, for different
reasons.

VB looks clean because the syntax is very simple and inflexible, and doesn't
allow you to do all that much. 95% of all VB programs are built-in language
constructs and functions.
Ruby has "everything is an object" and that's a very powerful abstraction.
The clean syntax is clever window-dressing on this very powerful and
consistent system.

While VB makes it easy to do a lot of the things you need to do all the
time, Ruby makes doing more complicated things almost as easy. Dynamic
typing and being able to change classes or objects' behaviour as you need to
is cool. Blocks make it easy to pass code around, which is useful
surprisingly often (coming from a Basic/Java background).
OO + duck typing + blocks = you won't like VB as much afterwards.

>>I went on a computer language
>>site that documented the history of computer languages and their lineage.
>>
>>It was quite a shock to learn that Ruby may possibly be the brother of VB,
>
> There was apparently a language which was the precursor to VB which
> was called Ruby. That Ruby became VB, however that other Ruby has
> nothing to do with the Ruby we're dealing with here on this
> newsgroup/mailing list. Actually, about a year ago one of the creators
> of that other Ruby (Mike Geary) was hanging out here on c.l.r (I think
> he even made the 100,000th post). If he is
> still lurking, perhaps he can offer more info on that other Ruby.
>
>>and that Ruby is the son of Algol 60. Just a cursery glance over Ruby
>>confirmed that my beloved "begin" and "end" are there. Sharing the same
>>genes as a Algol is quite a statement of pedigree.
>
> Well, lots of languages came out of the Algol branch of the
> computer language family tree.

IMHO, Ruby is like Perl, but the object-orientation aspect of it is not
tacked on with sticky-tape, it's right at the foundation where it should be.
And it looks better.

>>No wonder 60 percent of
>>all programers speak VB to their computers. And now, my fellow Algol 60
>>decendants, I am now close to making Ruby my langauge of choice. My
>>langauge, VB, is dying a cruel cancer of corporate apathy, but now I have
>>found its brother so I am rejoicing.
>>
>>So my question is, what do I need to know to get started from a VB
>>background?
>
> Having never coded in VB, I'm not sure I'm qualified to point you in the
> right direction, however, I would start by getting a copy of Dave Thomas'
> "Programming Ruby" 2nd edition. I suspect you'll find that Ruby is very
> different from VB, but if you stick with it I suspect you'll be
> pleasantly surprised and you'll probably learn a lot.

I have coded in VB, but I haven't heard of anything specifically for VB-ers.
But the Pickaxe II [1] is great if it is (as it's reputed to be) as good as
Pickaxe I [2]which I have used, updated to Ruby 1.8. Also check out Why's
(Poignant) Guide to Ruby [3] and/or Matz' Ruby User's Guide [4].

Cheers,
Dave

[1] http://www.amazon.com/exec/obidos/ISBN=...
[2] http://www.whytheluckystiff.net/rub...
[3] http://www.poignantguide...
[4] http://www.ruby-doc.org/docs/User...


James Britt

3/21/2005 4:34:00 AM

0

Dave Burt wrote:
>
> VB looks clean because the syntax is very simple and inflexible, and doesn't
> allow you to do all that much. 95% of all VB programs are built-in language
> constructs and functions.

Wow. We have very different VB exposure. Most VB code I've worked with
involves numerous custom classes and interfaces, along with assorted
calls to the Win32 API.

Late binding and the Variant data type are quite handy, too, for dynamic
programming.

Writing apps that exposed an OLE automation API (so you can script
instances using external scripts), as well has hosting the Windows
script control (so your application itself can load scripts), was quite
entertaining.



vruz

3/21/2005 4:56:00 AM

0

> > VB looks clean because the syntax is very simple and inflexible, and doesn't
> > allow you to do all that much. 95% of all VB programs are built-in language
> > constructs and functions.
>
> Wow. We have very different VB exposure. Most VB code I've worked with
> involves numerous custom classes and interfaces, along with assorted
> calls to the Win32 API.

Yeah, you get all sorts of language constructs both in VB and Ruby...
But I bet in VB you can't get something like "Microsoft's Poignant
Guide to Visual Basic" !

you can't beat that :-)


James Britt

3/21/2005 5:10:00 AM

0

vruz wrote:
>>>VB looks clean because the syntax is very simple and inflexible, and doesn't
>>>allow you to do all that much. 95% of all VB programs are built-in language
>>>constructs and functions.
>>
>>Wow. We have very different VB exposure. Most VB code I've worked with
>> involves numerous custom classes and interfaces, along with assorted
>>calls to the Win32 API.
>
>
> Yeah, you get all sorts of language constructs both in VB and Ruby...
> But I bet in VB you can't get something like "Microsoft's Poignant
> Guide to Visual Basic" !
>
> you can't beat that :-)

Not specifically VB, but:

Mr. Bunny's Guide to ActiveX

http://www.mrbunny.com/m...
and
http://www.amazon.com/gp/reader/...

James
--

http://www.ru...
http://www.r...
http://catapult.rub...
http://orbjson.rub...
http://ooo4r.rub...
http://www.jame...


Dave Burt

3/21/2005 5:10:00 AM

0

"James Britt" <jamesUNDERBARb@neurogami.com> came back with:
> Dave Burt wrote:
>>
>> VB looks clean because the syntax is very simple and inflexible, and
>> doesn't allow you to do all that much. 95% of all VB programs are
>> built-in language constructs and functions.
>
> Wow. We have very different VB exposure. Most VB code I've worked with
> involves numerous custom classes and interfaces, along with assorted calls
> to the Win32 API.

I've certainly imported chunks of Windows API, and built pages of wrapper
functions to have them make sense in the VB context... I guess I sometimes
block those memories - maybe a psychological response. But I never got any
value whatsoever out of VB clunky classes. Classes made sense when I learned
Java.

The only VB I code now is behind MS Office, and in ASP (VBScript at least).

> Late binding and the Variant data type are quite handy, too, for dynamic
> programming.

True, but if you declare Variants you don't get context-menus full of
applicable properties and methods in the IDE's code editor. I often end up
declaring a fake variable just to get that list, then deleting it after
writing the line of code. Anyone?
Dim x as RecordSet
x.<look through list, pick the method, check the params it needs...>

> Writing apps that exposed an OLE automation API (so you can script
> instances using external scripts), as well has hosting the Windows script
> control (so your application itself can load scripts), was quite
> entertaining.

Gee, James, that does sound like fun, but I'll leave it to you!

Back to Ruby on the topic of scripts: I often imported
"Scripting.Dictionary" and "Scripting.Regexp" into VB/VBA/VBScript, and
Ruby's syntax sugar around these (hashes and regexps) I found a major
advantage over VB. Not to mention arrays, and having to ReDim Preserve them
to append to them. Argh.

Cheers,
Dave


James Britt

3/21/2005 5:29:00 AM

0

Dave Burt wrote:
> "James Britt" <jamesUNDERBARb@neurogami.com> came back with:
>>Writing apps that exposed an OLE automation API (so you can script
>>instances using external scripts), as well has hosting the Windows script
>>control (so your application itself can load scripts), was quite
>>entertaining.
>
>
> Gee, James, that does sound like fun, but I'll leave it to you!

That was in another life, but, given another thread going on here, I'm
amused to recall that back when I was doing VB (late '90s) I was also
writing what are now buzzworded as "AJAX" apps, using Internet Explorer
and ASP.


James


Dave Burt

3/21/2005 5:40:00 AM

0

"James Britt" <jamesUNDERBARb@neurogami.com> reminisced:
>
> That was in another life, but, given another thread going on here, I'm
> amused to recall that back when I was doing VB (late '90s) I was also
> writing what are now buzzworded as "AJAX" apps, using Internet Explorer
> and ASP.

That is cool. My other life doesn't even have computers in it.