6 ms·
Matz said he designed Ruby to optimize for developer happiness, it’s just a core principle of the language since it was created
by choxi 2y ago
Matz said he designed Ruby to optimize for developer happiness, it’s just a core principle of the language since it was created
- kuboble 2y agoHappiness of a developer writing code can be a misery of a one having to read / debug it. I worked in ruby for a couple years around 2009 and having to deal with a code that implemented most of its logic via method missing is still one of the strongest negative memories I have about coding.
- viraptor 2y agoAnother annoying one from that category is Ruby's forwarded methods. Since they're created via generated, injected code, you can't query which method it forwards to at runtime. Or not easily anyway.
- MatthiasPortzel 2y ago`binding.irb` and `show_source` have been magical in my Ruby debugging experience. `binding.irb` to trigger a breakpoint, and `show_source` will find the source code for a method name, even in generated code somehow.
- richjdsmith 2y ago… I’ve been using Ruby for years and never thought to use show_source like this in a debugger. Thanks kind stranger, you just made my day!
- RangerScience 2y agoYep yep, that's the whole "sharp knives" thing. What I advise (and aim for) is only pulling out the sharp knives for "library" code, but application code should stay "simple" (and this much more easily navigable). Otherwise you can absolutely make a bloody mess!