Remix.run Logo
digitaltrees 4 days ago

Ruby code is readable. So some of the documentation in say, Java, isn’t as necessary.

paulryanrogers 4 days ago | parent [-]

Debatable. I always found languages without parentheses inscrutable. To distinguish methods you have to have all method signatures memorized or rely on an advanced IDE with highlighting.

bluerooibos 3 days ago | parent [-]

> inscrutable. To distinguish methods you have to have all method signatures memorized or rely on an advanced IDE with highlighting.

I'm confident that you're either an outlier or have simply come across a terribly written or badly formatted Ruby codebase - considering Ruby (and Rails which followed the same principles) was created with the purpose of being highly readable (made for humans [1]).

What is advanced IDE highlighting? Do you mean.. colours? And memorising methods - huh?

I really struggle to see how you can't tell which lines here are methods - https://gist.github.com/davidlares/5d136fa54572ad98e711e3684...

[1] https://news.ycombinator.com/item?id=22090358

paulryanrogers 3 days ago | parent [-]

I don't mean method definitions. I mean method invocations.

bluerooibos 3 days ago | parent | next [-]

I see. In almost 10 years of using Ruby I can't say that ever bothered me.

digitaltrees 3 days ago | parent | prev | next [-]

But you can literally inspect and interrogate objects. You can ask what methods exist. You can even make new methods at run time.

paulryanrogers 3 days ago | parent [-]

Right. And that's the issue. I want to read at a glance, without having to ask tools. Monkey patching and lack of parentheses means dropping into a new codebase is like wading into a ocean of possibilities with every file.

digitaltrees 8 hours ago | parent [-]

The community does generally document monkey patching and meta programming constructs. All other code tends to be self documenting. That’s all I am saying.

paulryanrogers 4 hours ago | parent [-]

Perhaps I just didn't write enough Ruby. It all felt very hard to grok for the time I spent with it. Whereas other languages, even quite obscure ones, felt more parsable to me.

pmontra 3 days ago | parent | prev [-]

The guidelines I remember are no parentheses for DSLs, e.g. the Rails validation methods or the associations, and parentheses for the other methods.