Hacker News new | ask | show | jobs
by lopatin 753 days ago
If you think Python is like that, I advise you to never look at Ruby codebase.

But seriously, of course you can write Python one-liners or nested comprehensions, but I get the idea that it's not really Pythonic. They still want clear, iterative code. It's just more concise, but the idea is the same, but with less scrolling.

2 comments

> If you think Python is like that, I advise you to never look at Ruby codebase.

Like any other language you can write perfectly expressive and intelligible code in Ruby, and in fact it is quite common to do so. The first layer of a Ruby codebase tends to be approachable, it's only when you get into some of the bigger libraries that you get some tricky metaprogramming.

Even then I don't often see Rubyists write tricky/clever code for the sake of it. The metaprogramming usually has utility and is often the "right" way to do something, especially in say the Rails codebase.

Ruby is all about developer happiness. It's the founding principle and the guiding ethos of the community.

I don't think they're talking about Ruby code golf.

Another way of stating the GP's comment is that a Rubyist looking at a Python codebase will be shocked at all of the verbose boilerplate. Ditto for a Pythonista looking at C++ code.

    If you think Python is like that, I advise you to 
    never look at Ruby codebase.
The codebase for Ruby itself, or the codebase of your typical Ruby app or library?

I spent about a decade with Ruby and my general impression is that the community really moved away from overly-clever metaprogramming.

The codebase for the Ruby language itself is definitely a challenging read.