[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

ruby and C

poison tooth

4/24/2007 12:28:00 AM

Would it be easier to learn ruby if i knew C/C+/C++ or the other way around?

--
fish can't fly but birds can
birds can't swim but fish can

11 Answers

M. Edward (Ed) Borasky

4/24/2007 1:30:00 AM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

smc smc wrote:
> Would it be easier to learn ruby if i knew C/C+/C++ or the other way
> around?
>
It is easier to learn *programming* in Ruby than in C/C++. However, the
languages are different enough that if you *need* to know C/C++, I'd
focus on learning that, rather than learning Ruby first.

- --
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-res...

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail....

iD8DBQFGLV1TIqRAswy4LDARAunrAJ9huLG8ggodLsvajD4DvKVwxia1HACgldxO
lI0RbQtf+Kx0lrcfPowIPyc=
=zlEL
-----END PGP SIGNATURE-----

Tim Hunter

4/24/2007 1:49:00 AM

0

smc smc wrote:
> Would it be easier to learn ruby if i knew C/C+/C++ or the other way
> around?
>
I'm biased since I learned C in 1985, but if you don't know C (or
better, assembler) then you really don't know what your program is
doing. The Ruby translator is written in C, the core libraries and many
standard libraries are written in C, and many things in Ruby (printf,
for example) are named after the well-known C equivalents.

There are those who can argue eloquently that you don't need to know
what your program is doing at the C level and they're very persuasive.
At this point I can't decide if they're right or wrong. All I know is
that when I write Ruby code I frequently think about how such-and-such
Ruby abstraction is *really* implemented in C.

In any case you can't go wrong learning C. Somebody said that C is so
pervasive that it's "the atmosphere in which we live."

james.d.masters

4/24/2007 3:46:00 AM

0

On Apr 23, 5:27 pm, "smc smc" <fixxie.w...@gmail.com> wrote:
> Would it be easier to learn ruby if i knew C/C+/C++ or the other way around?

As others have mentioned, there are pluses and minuses to either
approach. Here is my take on either scenario:

1. C first, Ruby next: You learn the intricacies and then get spoiled
with the ease-of-use later and appreciate each language.
2. Ruby first, C next: Easy learning with forgivable syntax. When you
learn C, you'll find it "verbose" and strict.

John Joyce

4/24/2007 4:43:00 AM

0

get the book by Chris Pine, Learn to Program.
It's cheap and small and interesting. Mr. Pine uses it to teach
beginning programming to kids. He chooses to teach them Ruby rather
than other languages. Ruby gets out of the way most of the time. It
lets you focus on the skill of creating a program. Designing it and
testing and running it. In C this is a much more complicated task. If
you starting out, C will throw a lot of things at you at once.
If you need to learn some programming concepts, Ruby is a great place
to start.

But learning C is a good goal too. It really is the Latin of computer
languages. Many ideas and traditions come out of decades of C culture.

That said, either way you'll be fine, but get yourself a good text
editor which does colors and (if possible) auto completion. Learn to
use the command line too. Buy a good reference book for Unix.

Phillip Gawlowski

4/24/2007 5:02:00 AM

0

John Joyce wrote:
> get the book by Chris Pine, Learn to Program.

http://pine.fm/Learn...

To sneak a peak, you can find a complete tutorial (I don't have the book
itself, and thus cannot comment on the completeness of the content in
comparison to the book) to programming in general and Ruby especially.

Of course, _why's poignant guide shouldn't be amiss in Ruby specific
tutorials.

> It's cheap and small and interesting. Mr. Pine uses it to teach
> beginning programming to kids. He chooses to teach them Ruby rather than
> other languages. Ruby gets out of the way most of the time. It lets you
> focus on the skill of creating a program. Designing it and testing and
> running it. In C this is a much more complicated task. If you starting
> out, C will throw a lot of things at you at once.

I can recommend "C++ for Dummies" if you are new to C/C++. I haven't yet
had the patience to learn C/C++, though, but found the book a valuable
resource when I was dabbling in C/C++.
A tidbit of information: C has become a subset of C++, which, upon more,
introduced OOP to the C world.


> That said, either way you'll be fine, but get yourself a good text
> editor which does colors and (if possible) auto completion. Learn to use
> the command line too. Buy a good reference book for Unix.

Look long and hard for a good text editor / IDE (once you know what your
IDE should be able to do). What works for me, doesn't work for you (I
don't really like Eclipse, but I like NetBean's Ruby support, for example).

Get used to reading loads of documentation, most of which is dry and
boring, but packed with information.

Don't just get a Unix book, but install yourself a Linux / Unix derivate
(Ubuntu is a very good choice if you never, ever touched *nix). Darwin
(Mac OS X's Unix core) is available as download, too.

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan....
http://clothred.rub...

Eek! That was supposed to be My Special Law, _MY_ special law, I tell
you!

T/

John Joyce

4/24/2007 5:46:00 AM

0


On Apr 24, 2007, at 2:01 PM, Phillip Gawlowski wrote:
> http://pine.fm/Learn...
>
> To sneak a peak, you can find a complete tutorial (I don't have the
> book itself, and thus cannot comment on the completeness of the
> content in comparison to the book) to programming in general and
> Ruby especially.

It's an intro. Doesn't go into bigger topics. Focus on fundamental
things.

> Of course, _why's poignant guide shouldn't be amiss in Ruby
> specific tutorials

Of Course!

>
> I can recommend "C++ for Dummies" if you are new to C/C++. I
> haven't yet had the patience to learn C/C++, though, but found the
> book a valuable resource when I was dabbling in C/C++.
> A tidbit of information: C has become a subset of C++, which, upon
> more, introduced OOP to the C world.

Actually, C and C++ are still very closely related, but have
officially and technically branched off. C++ is no longer a superset
of C
however, Objective-C is a superset of C. Meaning, all C is valid
Objective-C. Not so with C and C++. (though we can say that most
small C programs probably are valid C++ programs)

C is not bad to learn, just painful at times (debugging) it is still
all around you, everywhere. That mobile phone in your pocket? C is in
it. In most single-purpose devices. Systems engineers use it all the
time. Ruby can be used to test and check C! Even to generate C.



poison tooth

4/24/2007 7:12:00 AM

0

looks like im going to be trying to learn C...


On 4/23/07, John Joyce <dangerwillrobinsondanger@gmail.com> wrote:
>
> On Apr 24, 2007, at 2:01 PM, Phillip Gawlowski wrote:
> > http://pine.fm/Learn...
> >
> > To sneak a peak, you can find a complete tutorial (I don't have the
> > book itself, and thus cannot comment on the completeness of the
> > content in comparison to the book) to programming in general and
> > Ruby especially.
>
> It's an intro. Doesn't go into bigger topics. Focus on fundamental
> things.
>
> > Of course, _why's poignant guide shouldn't be amiss in Ruby
> > specific tutorials
>
> Of Course!
>
> >
> > I can recommend "C++ for Dummies" if you are new to C/C++. I
> > haven't yet had the patience to learn C/C++, though, but found the
> > book a valuable resource when I was dabbling in C/C++.
> > A tidbit of information: C has become a subset of C++, which, upon
> > more, introduced OOP to the C world.
>
> Actually, C and C++ are still very closely related, but have
> officially and technically branched off. C++ is no longer a superset
> of C
> however, Objective-C is a superset of C. Meaning, all C is valid
> Objective-C. Not so with C and C++. (though we can say that most
> small C programs probably are valid C++ programs)
>
> C is not bad to learn, just painful at times (debugging) it is still
> all around you, everywhere. That mobile phone in your pocket? C is in
> it. In most single-purpose devices. Systems engineers use it all the
> time. Ruby can be used to test and check C! Even to generate C.
>
>
>
>


--
fish can't fly but birds can
birds can't swim but fish can

Kyle Schmitt

4/24/2007 2:17:00 PM

0

Late in the conversation but...
I learned the canonical basics (Apple &Q) of childhood, then Pascal.
then C++, then C...
It really wasn't a good way to go.

You're right to learn C first. It teaches you many of the good habits
people used to proclaim were taught by Pascal, except unlike Pascal,
it's useful. Once you start coding in Ruby, you may not use your C
much, but it's one of those languages you should at least be able to
read. Being able to read C, and having at least written some C, is to
a programmer like being able to read a circuit diagrams and
greek-letter laden papers is to an engineer. You don't have to be an
expert in writing it if you're not programming in it, but you should
be able to read it and understand it.

Learning C++ before C is painful, and then it will take great work to
get your C skills up to snuff. Learning C++ for your OO stuff may be
painful as well.

Since you're planning on learning some C, maybe learn C, learn ruby,
then if you want to branch out to OO in C, learn C++ :)
(obj C is a cool choice too, but not widely used outside of OSX)




On 4/24/07, smc smc <fixxie.wits@gmail.com> wrote:
> looks like im going to be trying to learn C...

Martin DeMello

4/24/2007 2:27:00 PM

0

On 4/24/07, smc smc <fixxie.wits@gmail.com> wrote:
> Would it be easier to learn ruby if i knew C/C+/C++ or the other way around?

One of the first things you'll learn is that C/C++ is an uneasy
pairing - despite C++ being based on, and backward-compatible with C
they're pretty different languages.

martin

John Joyce

4/24/2007 3:03:00 PM

0

Don't quit Ruby though. It's different enough from C that one may
make the other make sense in a way.
It doesn't hurt to learn C first, but it isn't necessary to master it.
You will indeed find that other languages do things the way you wish
C did. C is really bare bones stuff. It's hard to feel productive and
useful with it compared to interpreted languages like Ruby, Perl,
Python or PHP.
Much terminology comes from C or before, and many fundamental
concepts are well established in C books, but don't feel like you
have to learn one language at a time. (more than 2 at a time would be
difficult though)
Most of them have a lot in common, so many things will carry over.
Many languages even look and work a lot like C does, but Ruby
certainly does have a particular beauty about it.
Learn both.
Many people do indeed use multiple languages. Certain languages are
good at certain things.
Some concepts are better illustrated and easier to manage mentally
with some languages.