I'm sure some other runtimes don't do it, too.
1,029 karma · joined March 11, 2009
I'm sure some other runtimes don't do it, too.
And method_missing is a such fundamental part of the language, that it obvious you skipped basic docs on the language. Besides that, there're not many "magic references". Unlike in python, btw, where "there should be 1 obvious solution to any problem" mantra doesn't hold for a veeery long time.
Main power of blocks is not being multiline or being closure-like, many languages have this. But blocks are not just anonymous functions or lambdas, they have ability to return from the outer method (or from the method to which it was passed with break), acting as a powerful tool for creating your own flow control structures if needed, or just replacing "for". Of the languages I know or heard of only smalltalk does the same.
You can live without those, you can live even without early return, but blocks are not a misfeature, it's a great and intuitive tool. And python's rudimentary lambdas make me cry a little.
Even worse, it gives simple tools to write plugins to sniff more logic related stuff, and I've seen projects where developers really went overboard with it.
this is an override in your project's .rubocop.yml
For me it's a bit opposite, I use and appreciate rubocop for simple formatting, not all of the rules but some of them, where autocorrect works. Recently I reformatted a big old project which was written by pretty sloppy developers who didn't care about whitespace, and it's just easier to work with now.
But I truly hate when rubocop tries to be smart about method calls, amount of lines in methods and amount methods or some other "code smell" metric.
yes, the tool allows to check for it, but it's not THAT smart. I have reasons. I'd happy to explain those reasons on code review to a human, but I'm not that happy to appease a dumb tool.
So, please do it as rails does, use bare minimals, something like https://github.com/rails/rubocop-rails-omakase
and ask other developers to stay away from .rubocop.yml
pbpaste > file
and if you're using zsh, just > file
is sufficient, without cat <file grep something | do something else ...
this works in bash too, but if you're using zsh, there're a couple of nice shortcuts <file
on it's own works as more file
and > file
...
...
^D
allows you to put something into the file quickly without firing up the editor. Though > file << end
...
end
will give you nicer line editing experience.more zsh redirection tricks here: https://zsh.sourceforge.io/Doc/Release/Redirection.html#Mult...