Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Ruby or Python?
Index -> General Programming
Goto page Previous  1, 2, 3, 4
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
PaulButler




PostPosted: Sun Dec 09, 2007 4:46 pm   Post subject: RE:Ruby or Python?

I think Ruby is a fine choice. McKenzie makes some good points, but I'm not sure how well they apply to the CCC.

- Ruby does have eval (eval "1 + 1" => 2), although I'm not sure if that would come in handy on the CCC.

- I could be wrong about this, but I thought list comprehensions were just syntax. Ruby does have list functions like map, which is one thing that list comprehensions can be used for. I don't know the full power of list comprehensions (yet), so maybe there is more to them that I am missing.

- Ruby has some basic functional capabilities, like closures and higher-order functions. I find Python's lambda more limiting than Ruby's, because Ruby treats all code blocks as the same (IIRC) but Python treats lambdas as a single statement, not a code block (that's my understanding, anyway).

- Automatic handling of big integers is a big one. It's nice to have the math taken care of without any extra effort on your part, and you don't get that in Ruby. If I remember, you don't have to deal with huge numbers in the CCC, but it's something to consider.

Personally I prefer Python myself, but it really comes down to a matter of preference, the languages are so similar in the power they give to a beginner. Maybe at higher levels they differ more, but they seem similar at the bottom.

By the way, good luck with the CCC MrHippo.
Sponsor
Sponsor
Sponsor
sponsor
richcash




PostPosted: Sun Dec 09, 2007 6:24 pm   Post subject: Re: Ruby or Python?

Quote:
- Automatic handling of big integers is a big one. It's nice to have the math taken care of without any extra effort on your part, and you don't get that in Ruby.

Ruby definetely does do that. It's one of its advantages.

As wtd and PaulButler said, I think ruby does everything on mckenzie's list fully well.

I am not qualified to judge, but it seems a bit useless for a beginner to learn both ruby and python simultaneously. They are too similar. Wouldn't you rather learn different types of languages with different concepts?
PaulButler




PostPosted: Sun Dec 09, 2007 7:21 pm   Post subject: Re: Ruby or Python?

richcash @ Sun Dec 09, 2007 6:24 pm wrote:
Quote:
- Automatic handling of big integers is a big one. It's nice to have the math taken care of without any extra effort on your part, and you don't get that in Ruby.

Ruby definetely does do that. It's one of its advantages.


Hmm, you're right, it does. It's weird, because I'm sure I remember doing something in irb just the other day that overflowed the number type, but now as hard as I try I can't get an error. I guess it was just my imagination.
MrHippo




PostPosted: Sun Dec 09, 2007 8:07 pm   Post subject: RE:Ruby or Python?

I'm checking out Why's Guide and it's pretty interesting and well-written Smile See where it takes me...

Hopefully by the end of December I'll at least have a clue how to program solutions to the easier problems I saw on the CCC website x_x

Thanks for the help everyone!

-MrHippo
Bobrobyn




PostPosted: Mon Dec 10, 2007 6:11 pm   Post subject: Re: Ruby or Python?

richcash @ Sun Dec 09, 2007 7:24 pm wrote:
I am not qualified to judge, but it seems a bit useless for a beginner to learn both ruby and python simultaneously. They are too similar. Wouldn't you rather learn different types of languages with different concepts?


I think a beginner would be better off learning one language fully (or close too), and then moving on, rather than two similiar languages like Ruby and Python but not getting as far. I learned Java and assembly in the same semester, but they're so different that they hardly interfered with eachotherr in my head. However, if I had to learn something as similiar as Ruby and Python at the same time, I would totally confuse the syntax. Heh.

My opinion: It doesn't matter which you learn first. Just learn it well, and then learn the one you didn't learn later.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 4 of 4  [ 50 Posts ]
Goto page Previous  1, 2, 3, 4
Jump to:   


Style:  
Search: