Live data from Hacker News

What Pythonistas Think of Ruby

blog.peepcode.com

71–80 of 247 posts

Re: What Pythonistas Think of Ruby

#71
post #70
post #67

Earlier quoted context omitted.

I've found quite the opposite; my experience with Python users has been consistently personable. If anything, the party line seems to be "this is the way we do things, if you like what you see, come on in, if not, no worries". I mean, this whole article is really just a troll post on Python by a Rube (that's what they're called, right?)

the party line seems to be "this is the way we do things, if you like what you see, come on in, if not, no worries" That is absolutely not the case; Python is the anti-TMTOWTDI. The Python community is very vocal and explicit about the conventions developers are expected to follow, more so than any other language I'm aware of: PEP 8, Zen of Python, non-stop critiques about whether some code is "pythonic" enough.

There's a difference between "why aren't you using Python?" and "why aren't you following standard Python coding conventions?".

Re: What Pythonistas Think of Ruby

#72
post #9
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!

These fancy new blogazines, as the kids are calling them, make me really wish I had design chops. My regular old blog looks so lame and uninteresting by comparison.

Raganworld's markdown rendered blog @ github http://github.com/raganwald/homoiconic has convinced me that while eye-candy and design is great, it is the content of the blog post itself that is of more value to me as a reader.

Re: What Pythonistas Think of Ruby

#73
post #71
post #70

Earlier quoted context omitted.

the party line seems to be "this is the way we do things, if you like what you see, come on in, if not, no worries" That is absolutely not the case; Python is the anti-TMTOWTDI. The Python community is very vocal and explicit about the conventions developers are expected to follow, more so than any other language I'm aware of: PEP 8, Zen of Python, non-stop critiques about whether some code is "pythonic" enough.

There's a difference between "why aren't you using Python?" and "why aren't you following standard Python coding conventions?".

Ah, I see. So what you are tying to say is that the non-stop bashing of Perl, PHP and Ruby from Python developers should be interpreted as just a friendly "if [you don't like python], no worries."

After all, one would have to be a "Rube (that's what [Ruby developers are] called, right?)" to think that Python developers aren't friendly to people who don't worship Python.

Re: What Pythonistas Think of Ruby

#74

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.

I'm sorry having dabbled in Ruby and having actively coded in Python and Lisp (Scheme, Clojure) you and the OP are laying the FUD on thick. I would argue Lisp has been able to stay relevant for so long because it's syntax assumes nothing about what domain you might be modeling. On the other hand, so little syntax means less "landmarks" and lot of programmers are put off by that.

Syntax is human and syntax is ergonomics. That's why languages with good syntax are so popular and deservedly so.

At the same time I think the number one reason languages eventually die off is because of syntax. A particular syntax was designed for solving specific kinds of problems. Then people realize there are deeper or different problems that the syntax cannot adequately address. Since the language is not a Lisp it cannot be repaired.

I think Python and Ruby are cool and useful tools, but I don't think their design will last another 50 years as Lisp probably will.

Re: What Pythonistas Think of Ruby

#75
post #45

I think this is a good explanation of some of the very real differences between Python and Ruby. The lambda issue is almost enough to get me back to Ruby after switching to Python. I stick with Python mostly because of syntax (especially significant whitespace) and the batteries-included philosophy. I'm also in love with a Python library called pyparsing, the equivalent of which I haven't seen in any other language.

I'm not sure I get the lambda issue. If you want a > 1 line lambda why not just define a function? def a(x): def b(): print x return b Not sure what a prototypical ruby usecase would be.

The other side of the argument: why support anonymous functions, but restrict them to one line? That seems highly arbitrary.

Re: What Pythonistas Think of Ruby

#76
post #45

Earlier quoted context omitted.

I'm not sure I get the lambda issue. If you want a > 1 line lambda why not just define a function? def a(x): def b(): print x return b Not sure what a prototypical ruby usecase would be.

The other side of the argument: why support anonymous functions, but restrict them to one line? That seems highly arbitrary.

Not one line, one statement.

Re: What Pythonistas Think of Ruby

#77

A main take away point: Ruby is better for writing DSLs (which is what I am doing for one customer right now)

Smalltalk is even better. Advanced Smalltalk is morphing Smalltalk into a DSL. You can even write your own domain specific if-then-else analogues, and it looks 1st class like the Standard conditional logic. Yet the implementation is just a plain vanilla method.

Re: What Pythonistas Think of Ruby

#78
post #45

Earlier quoted context omitted.

I'm not sure I get the lambda issue. If you want a > 1 line lambda why not just define a function? def a(x): def b(): print x return b Not sure what a prototypical ruby usecase would be.

The other side of the argument: why support anonymous functions, but restrict them to one line? That seems highly arbitrary.

Nope - not arbitrary, it is because of the indentation scoping rules. Try coming up with a syntax for statement based lambdas that isn't ugly as heck.

Re: What Pythonistas Think of Ruby

#79

Python versus Ruby has always struck me as one of the absurd battles ever. The two languages seem to address a very similar space and have broadly similar features sets. Yes there are points of variation but both seem to work really well. People build cool and useful stuff in both. People are productive in both. As for me - I personally like the syntax of Python better. That could be because I learnt it first - or it…

I think a big reason why it comes up so often is that it's rarely worth the mental real-estate to become proficient in both since they are so similar in design and problem domain.

There is significant diminished utility in learning python after knowing ruby or vice versa. You're better of learning something totally different (like haskell!) since you already have a flexible modern scripting language with a great web-framework in your toolkit.

However since each language has its trade offs, people have to keep convincing themselves (loudly and publicly, usually) that they made the right decision.

So basically, it's contentious and will always be that way for the same reasons that people still debate vim vs emacs after twenty years.

Re: What Pythonistas Think of Ruby

#80

    Python lambdas are limited to one line and can’t contain
    statements (for, if, def, etc.). Which leaves me
    wondering, what’s the point?
As much as I wish that the python lambda syntax was more powerful, they are ridiculously useful for one-liners where you can't use forms that require whitespace indentation. Everything must consist of set operations.

    cat file | python -c "import sys; lines=sys.stdin.readlines(); lines_i_care_about = [str(l.split(',')[2]) for l in lines if l.split(',')>=3]; print '\n'.join( lines_i_care_about )
(yes you could do this example in awk or sed, but that's not the point)
Post reply on HN