Live data from Hacker News

What Pythonistas Think of Ruby

blog.peepcode.com

171–180 of 247 posts

Re: What Pythonistas Think of Ruby

#171

Earlier quoted context omitted.

I understand the intent, but I do not feel that it loses its incorrectness by taking it out of context. That people even feel this comparison is appropriate is what has me depressed. It represents a fairly fundamental set of misunderstandings.

> That people even feel this comparison is appropriate is what has me depressed. I agree; you can replace the term "DSL" with "API" in almost every case without losing any essential meaning. (You have to give the hipper-than-thou language pseudo-advocacy, but that's no loss.)

I think in those contexts, DSL is more a description of how an API feels to use, than a precise technical categorisation.`

Ergonomic distinctions are useful though, as is the distinction between declarative-style APIs and more imperative ones, which 'DSL' is often used to make.

Re: What Pythonistas Think of Ruby

#172
post #98
post #26

Earlier quoted context omitted.

I wholeheartedly agree that all languages should be judged on the quality of their libraries and implementation, as well as the success of the projects implemented on top of them. Ruby and Python have a pretty good track record there. One of the themes of Gary's talk was that Ruby is more expressive/flexible than Python, and lisp was thrown into the discussion as sort of a "gold standard" of expressiveness/flexibilit…

> I wish Python just had some kind of anonymous function syntax that was more rich than lambdas A lot of people keep saying this, including the article author, and I'm having trouble understanding why. Lambdas are for "one-liners", functions are for more-liners. Any time you want to write multiple lines in a lambda it's trivial to make it a named function. def listSomeTable(name): print name.center(40, "=") def getWe…

The real problem with lambdas in Python isn't that they're restricted to one expression, but that Python's implementation of closures is clumsy (due to a scoping ambiguity). The argument about whether lambdas should be named or not is a canard. In languages that make heavy use of lexically scoped functions defined on the fly (Scheme, ML, etc.), they're often given local names. The problem is that Python's locally defined functions are less expressive. Apparently making heavy use of closures is not "pythonic".

Re: What Pythonistas Think of Ruby

#173
post #50
post #39

Earlier quoted context omitted.

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

I have the definitive impression that the Pythonistas are more interested in this fighting than most other language cultures. I might be wrong, but I really can't mention any other group of people trolling Perl discussions. It is the same for Ruby? It really seems strange for a language which got the name from Monthy Python. (-: Is it some inferiority feelings to environments which are fun ? :-)

I might be wrong, but I really can't mention any other group of people trolling Perl discussions.

Everyone is out trolling the Perl discussions. PHP developers hate us, Java developers hate us, Ruby developers hate us, and Python developers hate us. I think this is funny, because we generally don't hate the other languages, we just embrace and extend their good ideas for Perl. (The Perl community has come up with a few good ideas on their own, but the best ideas have been borrowed from other languages. Moose is from Smalltalk and CL; PSGI is from Python; Plack is from Ruby; Catalyst is from Java; etc. I think, in general, the stolen ideas have been improved upon in Perl; I like using Moose a lot more than I like using CLOS -- and I like using CLOS a lot.)

The only place outside of the Perl community where I can admit to liking Perl (and not be flamed) is #haskell. But everyone is nice there.

(I've even been trolled in real life over my like of Perl. I was going after some girl, who apparently had a friend that was a Java developer. Perl came up, I came up, and it was resolved "he must not be very good at programming if he prefers Perl over Java". Guess who got the girl? Not the Perl programmer.)

Re: What Pythonistas Think of Ruby

#174
post #98
post #26

Earlier quoted context omitted.

I wholeheartedly agree that all languages should be judged on the quality of their libraries and implementation, as well as the success of the projects implemented on top of them. Ruby and Python have a pretty good track record there. One of the themes of Gary's talk was that Ruby is more expressive/flexible than Python, and lisp was thrown into the discussion as sort of a "gold standard" of expressiveness/flexibilit…

> I wish Python just had some kind of anonymous function syntax that was more rich than lambdas A lot of people keep saying this, including the article author, and I'm having trouble understanding why. Lambdas are for "one-liners", functions are for more-liners. Any time you want to write multiple lines in a lambda it's trivial to make it a named function. def listSomeTable(name): print name.center(40, "=") def getWe…

Giving people concise syntax for passing anonymous functions allows one to implement a lot of control-flow operations, and combinators from functional programming, as libraries, rather than language constructs.

In python, although they could technically be done as libraries, from a syntactic point of view, having to declare named functions and pass them explicitly as arguments rather defeats the elegance of the approach.

So instead we have special features and syntax added to the language, like with statements and list comprehensions, which are limited special cases of what can be expressed more generally with a nice syntax for passing closures as arguments.

Not that it necessarily matters, there's always a pythonic way to do the equivalent thing. Although a lot of the time it's more imperative, and my taste is for functional programming idioms where possible.

Re: What Pythonistas Think of Ruby

#175

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-…

I think you're absolutely right, here. Once you know one, you'll probably have much better returns from time spent learning a very different language (such as Erlang, OCaml, or C) than learning the other, barring exceptional circumstances.

Re: What Pythonistas Think of Ruby

#176

Earlier quoted context omitted.

You can't morph Smalltalk into a DSL as Smalltalk itself is nothing but a DSL; syntactically every single control structure is library.

I prefer to think of it this way: DSL are syntactic 1st class citizens in Smalltalk. (Not 1st class for optimizations, though) To say Smalltalk IDS is a bit useless. Sure, if your "domain" is some Turing-complete language.

> Sure, if your "domain" is some Turing-complete language.

Which is exactly what Smalltalk is. Pick any other domain, and you can use the same syntactic elements used to build the base language to extend it into that particular domain.

Ruby DSL's control structures tend to look nothing like Ruby the language's control structures; Smalltalk DSL's control structures look exactly like Smalltalk the language's control structures.

Re: What Pythonistas Think of Ruby

#177
post #119

Earlier quoted context omitted.

Oh, Lisp isn't so difficult once you get used to. Interestingly I find myself equally baffled when I have to read code with side-effects. There's just so much implicit state (and state changes going on in the background), you have to keep in your head. Pure languages are so much easier to understand.

I should probably try to learn lisp. I primarily use emacs, so it would make a lot of sense. Some of the ruby/rails stuff out there for emacs really isn't very good.

Emacs lisp is handy for toying around with the editor, but it's a horrible Lisp. It does not even have lexical scoping. You are much better off in terms of entertainment (through learning interesting stuff) with e.g. PLT Scheme or perhaps Arc.

(My comment about pure languages above was meant to highlight the joys of Clean and Haskell. Curry may also be worth a look. And Prolog, if you dare.)

Re: What Pythonistas Think of Ruby

#178
post #117

Earlier quoted context omitted.

Python generators (the ones you can get with "yield") are not just syntax. They can be viewed as a distant relative of continuations or lazy evaluation. Lisp (or lets say Scheme, because Common Lisp is ugly and imperative) does have some nice points. I rather like the syntax. But e.g. strict evaluation by default and lots of side-effects hamper the expressiveness and flexibility of the language.

You do Haskell don't you? :-)

Yes, and Clean.

I just like to counter those smug Lispians. Lisp has nice syntax, but the underlying semantics is nothing to write home about any longer. Add tail call optimization to Python (and perhaps continuations) and you have something similar to Scheme modulo syntax.

Re: What Pythonistas Think of Ruby

#179
post #109

Earlier quoted context omitted.

I don't know. Haskell is quite dogmatic in some ways. The people on the Haskell cafe mailing list don't strike me as rabid fanboys.

You must be joking. People like Dons run or use a blog spidering program for anything that mentions Haskell. In less than 10 minutes after posting anything remotely negative about Haskell, I have a horde of angry fanboys telling me how I am an idiot.

You may be right. That's why I only talked about the stuff I have some experience with, and that's the civilized Haskell cafe mailing list.

I guess that may (or may not) show that a single language can be part of different cultures.

Re: What Pythonistas Think of Ruby

#180
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.

I reuse code a lot. If I write code in Ruby, I can't reuse it in a Python project. Since Python and Ruby occupy the same niche, I will often want to reuse code. (This is less of an issue if I want to use Python and C++. I'll rarely want to reuse linear programming code or a PDE solver in Python, and if I did, I would just wrap the C++. Similarly, I never want to use code I've written for the web in C++.)

Using a dynamic loadable C library from Ruby is neat and easy.
Post reply on HN