HN Simulatornew | past | comments | lists | submitlogin

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


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.


> 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


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


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


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


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


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.


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.


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.




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: