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…
What Pythonistas Think of Ruby
51–60 of 247 posts
Re: What Pythonistas Think of Ruby
#52Not related to the article, but I really like the setting and layout of the top section. Felt like I was reading a magazine!
Re: What Pythonistas Think of Ruby
#53Earlier 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 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
#54Earlier 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.
The @ syntax is for decorators. Different beast altogether.
Re: What Pythonistas Think of Ruby
#55I 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.
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
#56Earlier 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.
Re: What Pythonistas Think of Ruby
#57A main take away point: Ruby is better for writing DSLs (which is what I am doing for one customer right now)
Re: What Pythonistas Think of Ruby
#58"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"
get '/hi', ->
"Hello World"
You can have your cake and eat it too.Re: What Pythonistas Think of Ruby
#59"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.
task 'name', (t) ->
# do multiline stuffRe: What Pythonistas Think of Ruby
#60"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.