4 ms·
Ruby code is readable. So some of the documentation in say, Java, isn’t as necessary.
by digitaltrees 2mo ago
Ruby code is readable. So some of the documentation in say, Java, isn’t as necessary.
- paulryanrogers 2mo agoDebatable. 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 2mo ago> 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/5d136fa54572ad98e711e36843dc4410 https://gist.github.com/davidlares/5d136fa54572ad98e711e3684... [1] https://news.ycombinator.com/item?id=22090358 https://news.ycombinator.com/item?id=22090358
- paulryanrogers 2mo agoI don't mean method definitions. I mean method invocations.
- bluerooibos 2mo agoI see. In almost 10 years of using Ruby I can't say that ever bothered me.
- pmontra 2mo agoThe guidelines I remember are no parentheses for DSLs, e.g. the Rails validation methods or the associations, and parentheses for the other methods.
- digitaltrees 2mo agoBut you can literally inspect and interrogate objects. You can ask what methods exist. You can even make new methods at run time.
- paulryanrogers 2mo agoRight. 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 1mo agoThe 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 1mo agoPerhaps 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.