Live data from Hacker News

Why Ruby Is More Readable Than Python

confuzeus.com

41–50 of 149 posts

Re: Why Ruby Is More Readable Than Python

#41
post #31

Ruby, like so many other good things, is best enjoyed alone :-) I've loved every Ruby codebase that I've written. I still consider it one of my favorite programming languages, and (in pedagogical terms) one of the best languages for learning "practical" functional programming (point-free style, blocks as intuitive closures, &c.). But when I work with others, I find that all of the things that I love are obnoxiously c…

My theory is this is also why Lisp never took off. Powerful macros are wonderful for the solo programmer but difficult for a large team to reason about.

I think this is a tooling problem, as far as LISPs go, because unlike C, you (as far as I remember, perhaps I'm wrong) aren't relying on the compiler to fill in the bits, the macro is just a shortcut, if you will, to functionality.

Not always transparent, but it should be solved with correct tooling. I think the bigger problem was LISP was far too long tied to LISP Machines, rather than being able to run independently on any hardware, which helped C and Pascal gain traction early

Re: Why Ruby Is More Readable Than Python

#42

Ruby, like so many other good things, is best enjoyed alone :-) I've loved every Ruby codebase that I've written. I still consider it one of my favorite programming languages, and (in pedagogical terms) one of the best languages for learning "practical" functional programming (point-free style, blocks as intuitive closures, &c.). But when I work with others, I find that all of the things that I love are obnoxiously c…

Interesting!

I spent a few years doing ruby in pair programming contexts and never had that problem. It was a great experience for me. I guess we didn't have that problem because pairing both gives you immediate feedback on "too clever" and because it's much easier to understand a clever thing if you do it with somebody rather than coming across it later in the code.

Re: Why Ruby Is More Readable Than Python

#43

Ruby, like so many other good things, is best enjoyed alone :-) I've loved every Ruby codebase that I've written. I still consider it one of my favorite programming languages, and (in pedagogical terms) one of the best languages for learning "practical" functional programming (point-free style, blocks as intuitive closures, &c.). But when I work with others, I find that all of the things that I love are obnoxiously c…

I chalk that up to the higher pain threshold

I never could quite articulate why Python doesn’t resonate with me without hyperbole or snark or both.

But that’s it. Python’s design includes inducing pain deliberately with the rational that I deserve it.

Don’t misunderstand me. I think Python is useful. It is just that I don’t find it enjoyable and I inflict enough pain on myself with my code.

Re: Why Ruby Is More Readable Than Python

#44
“ I didn't work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it's not perfect for you. The perfect language for Guido van Rossum is probably Python.”

“I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.”

- Yukihiro Matsimuto

Re: Why Ruby Is More Readable Than Python

#45
Maybe I am an outlier, but the few jobs I have had with a ruby codebase have been super fun and relatively easy to pick up. Every project has a learning curve, and I have experienced some pretty bad ones that were not written in Ruby.

Re: Why Ruby Is More Readable Than Python

#46
Moving to Python from Ruby, one very early scarring experience was battling trying to get the length of a string, before eventually discovering len() - a free function, whereas in Ruby (OO purist that it is), everything is a method.

Well I thought this was rather silly and counterintuitive of Python, and said so in some forum or other, whereupon i discovered the very passionate views of folks who have come down hard on one side or other of this debate.

So, lesson learned: keep one's opinions on such matters to oneself, as one man's banquet is another's poison. In which vein, it would be splendid if this comment did not occasion another screed about the manifest glories of __len__ to enlighten us heathens.

Re: Why Ruby Is More Readable Than Python

#47
post #31

Ruby, like so many other good things, is best enjoyed alone :-) I've loved every Ruby codebase that I've written. I still consider it one of my favorite programming languages, and (in pedagogical terms) one of the best languages for learning "practical" functional programming (point-free style, blocks as intuitive closures, &c.). But when I work with others, I find that all of the things that I love are obnoxiously c…

My theory is this is also why Lisp never took off. Powerful macros are wonderful for the solo programmer but difficult for a large team to reason about.

You're not the only one, "The Lisp Curse"[1] essentially says the same thing (but spends a lot more time praising/criticizing the "lisp hacker").

> The expressive power of Lisp has drawbacks. There is no such thing as a free lunch. > - The Lisp Curse

[1]: http://winestockwebdesign.com/Essays/Lisp_Curse.html

Re: Why Ruby Is More Readable Than Python

#48
post #40

There's more than one way to write the corresponding Ruby snippet. If I had been writing it, I might have translated it something like this: class BlogPost class This avoids needing to understand what `@@count` means, and lets you use the same syntax as in python: `BlogPost.count += 1`. Or, if I were in a codebase using static type annotations with Sorbet, I'd do something like this[0]. To each their own, write code…

That’s without even mentioning the footguns available in @@count

Jez!

Re: Why Ruby Is More Readable Than Python

#49
post #13

Until metaprogramming, autoloading, DSLs and everything that eventually makes Ruby code unreadable takes place due to personal preferences. Ruby is clever, it can be beautiful, but I've never seen a good codebase using it grow well without enforcing strictly opinionated ways of writing it to ensure maintainability. Which breaks a lot of the expectations of some Ruby developers that chose the language because they lik…

> without enforcing strictly opinionated ways of writing it to ensure maintainability

But a team cannot have its own opinions with Python. They're already built in.

Re: Why Ruby Is More Readable Than Python

#50
post #42

Ruby, like so many other good things, is best enjoyed alone :-) I've loved every Ruby codebase that I've written. I still consider it one of my favorite programming languages, and (in pedagogical terms) one of the best languages for learning "practical" functional programming (point-free style, blocks as intuitive closures, &c.). But when I work with others, I find that all of the things that I love are obnoxiously c…

Interesting! I spent a few years doing ruby in pair programming contexts and never had that problem. It was a great experience for me. I guess we didn't have that problem because pairing both gives you immediate feedback on "too clever" and because it's much easier to understand a clever thing if you do it with somebody rather than coming across it later in the code.

Yeah, I think pair programming (and constructive review) go a long way towards ameliorating this issue.
Post reply on HN