General Question

segdeha's avatar

Python or Ruby?

Asked by segdeha (1720points) July 13th, 2007

This is a question for the geeks out there. If you had to choose between Python and Ruby, which language would you use to build your next, great website ... and why?

Observing members: 0 Composing members: 0

16 Answers

Vincentt's avatar

Well... I'd go for Python because it's Dutch ;-)

Seriously though, I think I'd prefer Python but I haven't looked into it that much. It's just that Ruby only seems to have gotten popular because of RoR (I believe both languages seem to exist about the same time).

But then again, I'd also choose Python because it seems more suitable for desktop applications which I also want to get my hands at some time. It would be useful when, when I am going to try my luck at desktop applications, I wouldn't need to learn an entire new language.

mirza's avatar

i would prefer python cause it looks like python is just more famous these days. Also because i dont know ruby

andrew's avatar

It's really a personal taste... which language do you prefer? Python just made more _sense_ to us at Fluther... it was like a perfect mix between the ease of Perl and the structure of Java, but some people can't stand the whole whitespace indentation thing.

And of course, I'd use django as the web framework.

glial's avatar

PHP....oh sorry that wasn't a choice.

antimattar's avatar

whew, if this doesnt start a flame war then you can be sure the geeks arw sparse on fluther. I'd say: python... Apps, libraries, history, django, name ;)

segdeha's avatar

I'd been "programming" in PHP for a few years (and ColdFusion before that) when I started working somewhere where Python was de rigeur. I fell in love with the sparseness of the language and even with the whole "indentation matters" thing. My experience with Ruby is pretty limited, but I have friends (who know a lot more than me about the intricacies of these things) who rave about it. My current job is again doing PHP stuff. At least we're using a proper framework (symfony), but I'd love to push them to go to either Rails of Pylons (my first choice being Pylons). Google only lets certain languages in the door (mostly to manage complexity), and Python is one of them. if that matters.

@Vincentt, apparently there is a Ruby to Cocoa bridge, so maybe it's also suitable for desktop apps. http://rubycocoa.sourceforge.net/HomePage

@mirza, fame is pretty subjective. I'd say more developers are aware of Ruby on Rails than they are of Pylons, TurboGears, Django, or even Zope. But, that probably depends on a lot of factors.

@andrew, my sentiments exactly.

@glial, no PHP was deliberately *not* a choice. :-) PHP's greatest strength is that it allows for quick and dirty development. PHP's greatest weakness is that it allows for quick and dirty development.

@antimatter, yes I asked this in part out of curiousity about whether it would spark a little religious conflict. So far, not so much!

segdeha's avatar

A perfect example of why I'd like to see the ability to edit responses: "...Rails of Pylons..." should, of course, read "...Rails or Pylons...".

Vincentt's avatar

sedgeha, surely you'll be able to program desktop applications with Ruby, but you can do so with PHP too ;-)

But Python is also widely used for desktop applications, which is why it's attractive.

Also, as Andrew says, "some people can't stand the whole whitespace indentation thing." However, if you can stand it, then it's probably also a very attractive feature because it makes your code more readable to others and the other way around.

ChosenOne's avatar

Ruby's scored a lot of points with language-buffs because of the clean syntax and some of the interesting language features. Introspection is more integrated with the language. Code blocks save you a lot of typing and make code much clearer:

files.each do |f|
f.write("text")
end

--or--

files.each {|f| f.write("text") }

The do-end or curly-braced blocks are passed to each file in the list 'files'. 'For' loops are almost completely unnecessary.

Also, rails is a very good and increasingly popular web platform. Personally, it is the language that attracts me, though many have come into ruby because of rails.

The downside is that ruby is one of the slowest interpreted languages out there. Python and PHP are both faster. Java is one of the fastest due to recent JVM improvements. Ruby is slow because of its parser, which is more complex than most languages; work is being done to make rails scale onto multiple databases. Page caching and other such technologies can bring it almost up to speed with the rest.

gooch's avatar

I am no geek and I used python so I guess you can say its easy

zerok's avatar

For websites and only websites? It probably doesn't really matter. Just look around and check if what you want to do is already done by some library for any of these languages and then just take the language that has the better library for your task available.

Jadelyn's avatar

I prefer a Python because they are GREAT interactive pets(:

Naked_Whale_Tamer's avatar

Python because of the Wing IDE. My post won’t fully answer your question (“Python or Ruby”) because I’m haven’t used Ruby but please bear with me.

Why did I choose Python over Ruby?

At the time I could have used either Python or Ruby and I basically flipped a coin and chose Python. I wrote several toy programs in Python and found that I was rapidly learning the syntax and idioms (I already know of bunch of other programming languages). I especially like the lack of braces (no more of those horrible endless brace placement flame wars that destroy forums).

Luckily, early on I came across a suggestion that I try out the Wing IDE. Free 30 day non-crippled trial. With Wing, I’m able to step through the code, inspect and modify variables, dynamically check for certain bugs (but I still used lint), great code editor. I paid for the package out of my own pocket.

If I had any problems, I would email the Wing developers and typically got a response within hours or, at worst, in a day or two. They (there are are only two guys) would answer any question; even programming questions.

I used a lot of free Python libraries which greatly improved my Python productivity. Since I never tried Ruby, I can’t say if Python is better or worse than Ruby (although I don’t know how one can objectively define better or worse).

With Wing, I could debug my client side Python code then seamlessly debug my back-end Python code. I would know what variables were being sent to the back-end and what variables were being set back to the client.

I tried the free Eclipse IDE before discovering Wing and I absolutely hated Eclipse for so many reasons; Eclipse is primarily oriented towards Java.

Just in case you’re wondering, I have absolutely no direct or indirect connections to Wing.

Response moderated (Spam)
Response moderated (Spam)
Response moderated (Spam)

This discussion has been archived.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther