3 ms·
> missing syntax, generated identifiers I’ve been writing Ruby for almost ten years now, and I honestly have no idea what these refer to.
by Toutouxc 2y ago
> missing syntax, generated identifiers
I’ve been writing Ruby for almost ten years now, and I honestly have no idea what these refer to.
- IshKebab 2y ago1. It leaves out parentheses in places where they really should be there for clarity. Ok it's not nearly as bad as e.g. OCaml, but it's still a downside. 2. Basically Ruby code seems to favour magically generating methods and variables based on other strings, which makes them impossible to search for. Other languages sometimes do that too, e.g. ill-advised __dict__ Python tricks, or with macros in C++ or Rust. But it's definitely worse in Ruby, and it's a common complaint (search for "magic" in these comments). I literally have given up following Gitlab's code before. That never happens in better languages, e.g. I can easily follow VSCode's codebase (Typescript) or gitlab-runner (Go).
- fknorangesite 2y ago> 2. Basically Ruby code seems to favour magically generating methods and variables based on other strings, which makes them impossible to search for. You might be talking about Rails here and not Ruby per se.
- IshKebab 2y agoYou might be right, but Rails is always touted as one of the best things about Ruby...
- IshKebab 2y agoI happen to have just come across another case of this, not in Rails. In Asciidoctor, which is unfortunately written in Ruby, where is `convert_inline_anchor` called from? https://github.com/search?q=repo%3Aasciidoctor%2Fasciidoctor%20convert_inline_anchor&type=code https://github.com/search?q=repo%3Aasciidoctor%2Fasciidoctor... Nowhere apparently! Until you eventually find this monstrosity: https://github.com/asciidoctor/asciidoctor/blob/8d3f6230c964b79f848e71dce9d00e811368439f/lib/asciidoctor/converter.rb#L382-L397 https://github.com/asciidoctor/asciidoctor/blob/8d3f6230c964...