Live data from Hacker News

What Pythonistas Think of Ruby

blog.peepcode.com

51–60 of 247 posts

Re: What Pythonistas Think of Ruby

#51

As someone who did nothing but Rails since 06 (two Rails-powered startups, plus some Rails contracting), allow me to explain why I dumped Ruby/Rails and switched to Python/Pylons. Batteries. Ruby is great, but outside of Rails you are on your own. Even basic things like geometry needs to be coded by hand. Python (and almost anything else) simply destroys Ruby when it comes to generic non-web centric libraries. And th…

If I start every conversation with Python developers with a rant about how their language/frameworks suck I'm sure they wouldn't be very friendly with me.

Re: What Pythonistas Think of Ruby

#52
post #5

Not related to the article, but I really like the setting and layout of the top section. Felt like I was reading a magazine!

Something weird is happening in that layout though. Maybe it's just Chrome/Webkit but if you double click anywhere a grid overlays itself onto the page. It seems to be on purpose ( background-image: url(http://blog.peepcode.com/images/grid/27px-leading-w-60-80-gr...); ) but it seems quite bizarre.

Re: What Pythonistas Think of Ruby

#53
post #39
post #37

Earlier quoted context omitted.

Do you really have to switch from one to another? I learned both languages, love them both, and use them both. There's too much hate in the world of programming languages.

The fights are so vicious because the stakes are so small. (Originally said about academics, but works for programmers, too.)

I don't think the fights should be vicious, but I think the stakes are fairly high, and even though Ruby and Python are close cousins in the grand scheme of things, they really do represent profoundly different philosophies when you look more closely at the languages. It would be nice if these differences could always be discussed with civility, of course.

I use both Ruby and Python enough to appreciate that both languages generally make important tradeoffs with good intentions, but I don't always agree with the results (in either language). I also find Javascript often has an interesting relationship to both languages.

Re: What Pythonistas Think of Ruby

#54

Earlier quoted context omitted.

As a Pythonista I have no idea what the Ruby snippet is doing. Readability depends entirely on context. The Python 3 version is using a function annotation. In Python 2 or 3 you could use a context manager (with statement) to similar effect.

> As a Pythonista I have no idea what the Ruby snippet is doing. Fair enough. Arguing over beauty is silly anyway, I just wanted to point out that the entire thing is entirely subjective. > The Python 3 version is using a function annotation. Thanks, checking out PEP 3107 now. I've always seen annotations done with the @annotation syntax like the Python 2 snippet has.

> Thanks, checking out PEP 3107 now. I've always seen annotations done with the @annotation syntax like the Python 2 snippet has.

The @ syntax is for decorators. Different beast altogether.

Re: What Pythonistas Think of Ruby

#55

I am one of those people who accepted the lisp religion of "syntax is evil". I have a descent knowledge of python, and I've read a few ruby tutorials. Neither python nor ruby are lisp. Python is not cool because of generators, list comprehensions, decorators or any other feature. Ruby is not cool because of blocks or monkey patching(im suspicions of anything called MONKEY patching). Ruby and python are cool because o…

Syntax is human. Syntax is ergonomics. A programming language is the bridge between man and machine. Lisp, I would argue, is far more about the machine than the man and that is the simple reason why it's not more popular. Python was cool before the libraries; that's why those libraries got written in the first place. Lisp has been around forever and is still lacking in libraries and other support.

"Lisp, I would argue, is far more about the machine than the man and that is the simple reason why it's not more popular."

Pleas do, i would love to hear your argument. I fail to see how lisp is less humane than python, when i find it to be exactly the opposite.

Edit: what i meant was that lisp is more about the human, not that python is more about the machine, i hope i don't get misunderstood.

Re: What Pythonistas Think of Ruby

#56

Earlier quoted context omitted.

Python doesn't have multiline lambdas, so there is no way to create an api similar to rake's: task :name do |t| # do stuff end I'm not sure what's the closest equivalent syntax you could create in python.

Not sure what this snippet does, but if it creates a block that is registered as a task named "name", then you can do the same with decorators: def task(f): register_task(f.__name__, f) return f @task def name(t) ..... or similar.

Exactly. I fail to understand why people are so dismissive of languages/approaches that do things slightly differently and don't implement equivalent things in the exact same way. What's so special about the rake syntax?

Re: What Pythonistas Think of Ruby

#58
post #17
post #12

"Without powerful blocks and lambdas, you can’t have Rake. You can’t have RSpec. You can’t have Sinatra’s clear REST syntax." Can anyone explain why?

Disagree on "REST syntax". Python could do just as well: Sinatra: get '/hi' do "Hello World!" end Python 2: @get('/hi') def hello(): return "Hello World" Python 3: def hello() -> "/hi": return "Hello World"

Just for kicks. In CoffeeScript:

    get '/hi', ->
      "Hello World"
You can have your cake and eat it too.

Re: What Pythonistas Think of Ruby

#59
post #12

"Without powerful blocks and lambdas, you can’t have Rake. You can’t have RSpec. You can’t have Sinatra’s clear REST syntax." Can anyone explain why?

Python doesn't have multiline lambdas, so there is no way to create an api similar to rake's: task :name do |t| # do stuff end I'm not sure what's the closest equivalent syntax you could create in python.

Another CoffeeScript snippet, if you're working with Node.js or the like:

    task 'name', (t) ->
      # do multiline stuff

Re: What Pythonistas Think of Ruby

#60
post #12

"Without powerful blocks and lambdas, you can’t have Rake. You can’t have RSpec. You can’t have Sinatra’s clear REST syntax." Can anyone explain why?

For something like RSpec, you can't monkey-patch in Object#should.

Are you saying this because you can't monkey-patch literals? Because you can very much monkey-patch everything else in Python.
Post reply on HN