You are not logged in.

#1 2006-09-12 12:58:14

Gustavo
Member
From: Brazil
Registered: 2006-07-04
Posts: 92

Ruby or python as a starting point?

Hello,

I wanna learn one of the two languages, just for fun. I don't know any other programming language. My knowledge in this area is 0.

Which one is easier to learn? I'm a bit inclined to python because of its larger documentation.

Thanks and regards,

Gustavo

Offline

#2 2006-09-12 13:50:22

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Ruby or python as a starting point?

Gustavo wrote:

I'm a bit inclined to python because of its larger documentation.

That's more than a bit of an advantage if you're brand new to it. I can't give an unbiased answer to the "which is easier to learn" question because  I haven't given Ruby the chance it deserves. But the reason for that was because it wasn't easy to learn. Or something.

From the perspective of a programmer wanting to see new users have good programming skills, the main difference between the two is that Ruby is completely object oriented, and Python provides objects as a convenience. Most teachers nowadays seem to think you should get an object oriented concept of programming in your mind early on. However, I think a small majority of advanced programmers (or maybe its just me!) think that once you know object oriented programming, you should also know when its not necessary.

Learning to program well is more important than the language you use. I would suggest you try learning one or the other, and if you don't like the way it makes you feel, don't assume "programming sucks", but rather, assume you need to try a different language. There are so many out there, there's got to be a language to suit your personality.

Sorry if this sounds a little weird. Choosing a programming language is a lot like choosing between acrylics, water and oil when painting.

Dusty

Offline

#3 2006-09-12 18:14:57

toxic
Member
Registered: 2006-06-05
Posts: 117

Re: Ruby or python as a starting point?

It seems like Ruby has quite interesting future. It's a constantly growing language with many new additions to the language coming all the time. Ruby, being a modern style object oriented language will probably provide an easier way of programming to someone being new to the scene. I'd really sugest you find some code examples, then have a look at what feels more natural you.

Offline

#4 2006-09-12 18:41:28

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: Ruby or python as a starting point?

Dusty wrote:

Sorry if this sounds a little weird. Choosing a programming language is a lot like choosing between acrylics, water and oil when painting.

Yes, definitely. As my sig attests, I'm a Ruby person myself, but Dusty's comments are spot on. I don't program in Ruby b/c it's better (no judgement), I program in it because I find it to be a fun language. And, yes, it's rapidly growing in popularity, particuarly because of Ruby on Rails. I tried both Python and Ruby at the same time, and Ruby's the one that stuck for me. And, as to Dusty's comments about "good programmers", I will note I came to Ruby after working for many years with C, C++, and even some Java (purely academic). Point is, after having sampled the staples of programming, Ruby was refreshing, and is my choice for small projects I have for myself. However, experience has taught me what's appropriate when, both for languages and design and development methodologies. It's one thing to learn a language, it's another to learn its idioms, strengths, and weaknesses.

Having said all that, you did say you wanted to learn one for "fun." I'd personally recommend Ruby, but the real answer is: try both. Come up with a small but interesting project, and code it in both. You'll find out which you're more comfortable with pretty quickly.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#5 2006-09-12 19:31:38

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Ruby or python as a starting point?

I was in the same position 6ish months ago, debating between ruby and python. I dabbled in both of them and ended up choosing python. To me, python seems much more intuitive and I find the wealth of documentation (that you alluded to) extremely helpful. Looking back on things, I'm very confident I made the right decision with python. But that's just my story, and everyone has a different one.


I am a gated community.

Offline

#6 2006-09-12 19:54:40

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Ruby or python as a starting point?

I agree that the choice is personal, and if you are down to ruby or python, both are fine choices indeed, for a wide variety of tasks..

As for my *personal* opinion on the matter, the following two links go to a pair of blog articles about my decision to use python more often than ruby....

Link1
Link2


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#7 2006-09-12 20:16:54

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: Ruby or python as a starting point?

cactus wrote:

I agree that the choice is personal, and if you are down to ruby or python, both are fine choices indeed, for a wide variety of tasks..

As for my *personal* opinion on the matter, the following two links go to a pair of blog articles about my decision to use python more often than ruby....

Link1
Link2

I'm trying really hard to not let this become a religious war, but some quick comments wink (I would have posted them to your blog, cactus, but I thought they were germane to this conversation, so... here they are). I agree that Ruby code can sometimes lean towards being "too clever". I was originally attracted to Ruby because it was clean, it makes sense, and it reads like English. Sometimes. The problem is, it also has all these nifty clever little constructs and features. The temptation to quickly refactor a code block into a tigher, smaller snippet that is less readable is very strong. I'm not sure why this is, maybe it's just the nature of programmers. I try very hard not to do it, except in particular cases where performance can be improved. There are a lot of ruby techniques out there that aim to avoid unnecessary object creation, method calls, etc. So, I feel like a lot of the cleverness out there is also to do with performance. On the whole (meaning in "real world" situations), I feel like Ruby keeps up with the group in terms of speed and efficiency, but the truth is sometimes it's a bit sluggish. Of course, that starts bringing into the picture the issues of ruby v. python performance, byte compiling, and all that, which really isn't an issue for a majority of programming tasks (besides, if you want performance, whip out C wink).  So, yes. There are people out there doing "clever" things in Ruby. But, I feel like most of these are part of the "idioms" of the language; just as the ternary operator looks odd to neophyte programmers, but become second nature quickly, I feel like these relative arcane looking "clever snippets" become very readable as familiarity with Ruby improves. Really, I think the Ruby community values "good code" over "clever code" (the ruby mailing list has a weekly programming quiz; golfing is strongly discouraged in these quizzes).

As I stated at the beginning, I'm not looking for a religious war here, and I'm still not saying Ruby >>>>> Python or anything. I just thought I'd put down some thoughts on the whole "Rubyists are too clever for their own good" idea. It happens in all languages, and I find that in my experience, the Ruby community really values readable, intelligent code.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#8 2006-09-12 20:35:45

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: Ruby or python as a starting point?

For a quick lesson on basic Ruby ideas, there is a great interactive site called Try Ruby (clever name, ehh?) where you don't even have to have Ruby installed yourself (it runs your code directly on the server).  I highly recommend going through the introductory tutorials...

Offline

#9 2006-09-13 03:32:53

Gustavo
Member
From: Brazil
Registered: 2006-07-04
Posts: 92

Re: Ruby or python as a starting point?

Thanks for all the replies, they were all very helpful. I'm gonna go with python. I found a nice tutorial that will teach me some basics on how to program, using python in the examples. Ruby will come next. 8)

Thanks again,

Gustavo

Offline

#10 2006-09-13 04:48:28

Cirdan
Member
Registered: 2006-03-18
Posts: 64

Re: Ruby or python as a starting point?

Well..you guys have successfully gotten me interested in Ruby. smile It does look like a fun language.

Offline

#11 2006-09-13 04:57:26

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Ruby or python as a starting point?

Cirdan wrote:

Well..you guys have successfully gotten me interested in Ruby. smile It does look like a fun language.

It is indeed.
smile


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#12 2006-09-13 13:22:14

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Ruby or python as a starting point?

Hey Cactus, I just read the links, good read, reaffirms me unneed to learn Ruby until I have free time (I can't wait until retirement).

I notice you mention you like to have your if blocks and loops explicitly ended... that seems such a trivial thing to mention. Python has optional endif -- for short blocks you don't have to use it, for longer blocks, you can if you want.... see:

if mycode.iscool():
  self.always_uses_short_blocks = True
#end if

That's mostly TIC, but if you think it would make your python code easier to read, go ahead and close your blocks.

Dusty

Offline

#13 2006-09-13 18:13:43

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Ruby or python as a starting point?

I never thought of using comments as closure references before dusty..I might actually use that for an occasional few longer, more 'disjoint' feeling blocks.

smile Thanks!

As an aside, there is another thing, that I haven't touched on in my blog entries to date..it is the predominance of the rails community within the ruby camp. It is very helpful and good..up until you have a difference of some opinion on how something works, or should work.

There are alot of people that use ruby that don't use rails..but the rails folks are very .... visible..and highly opinionated.

Look at just about any blog post with wide readership, and see what happens when they make any negative statements about ruby or rails. It is almost shocking the level of vitriol that rises to meet it.

This is my perception at least, and part of the reason why I have gravitated more towards python of late....


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#14 2006-09-13 19:27:26

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: Ruby or python as a starting point?

damn python indented code <rants>

cactus.is.cool.for.sure

or in python

def cactus(self) : # who the hell is self anyway?
   blah.self
   return 'is cool for sure'

No a bit of both would be cool Rupy  :?


Mr Green

Offline

#15 2006-09-13 20:26:30

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Ruby or python as a starting point?

cactus wrote:

It is almost shocking the level of vitriol that rises to meet it.

This is my perception at least, and part of the reason why I have gravitated more towards python of late....

Hmmm... so its like arch... you feel better with the community that feels a bit more mature.

To me, Python and Arch have a lot of lofty goals in common, the same type of simplicity etc. I think that's why there seem to be more python coders than ruby here (not to say anything against the ruby users!) I think its similar for that other debate, Arch has more in common with the vi philosophy than the emacs one, so there is a tendancy to have more vim users in the Arch community. This is all informal observation, of course and I wouldn't want to exclude any user from Arch. Except a few select usernames from the past.

Dusty

Offline

#16 2006-09-13 22:35:20

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Ruby or python as a starting point?

Mr Green wrote:

damn python indented code <rants>

One man's trash is another man's treasure.


I am a gated community.

Offline

#17 2006-09-14 06:50:14

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: Ruby or python as a starting point?

very true lol


Mr Green

Offline

#18 2006-09-14 14:47:55

xenobrain
Member
From: Lodi, CA
Registered: 2006-05-31
Posts: 91

Re: Ruby or python as a starting point?

Admittably, I've never tried python  wink But I chose ruby and I'm not regretting it. It's the funnest language I've ever dabbled in, and it was the right choice for me as it allowed me to start using ruby on rails in my web designs.

Offline

Board footer

Powered by FluxBB