1,035 karma · joined Mar 11, 2009 (17y ago) · 496 submissions
comment 2y ago · link · parent
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.
comment 2y ago · link · parent
comment 2y ago · link · parent
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
comment 2y ago · link · parent
<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...
comment 2y ago · link · parent
comment 2y ago · link · parent
I've worked in company which added a "funny" codename to everything: features, libraries, sprints, sections of backoffice interface. I don't know, maybe for some developers it makes things more engaging, for me it added a ton of unnecessary stuff to memorize or look up.
Also one of the reasons I don't like AWS. You really can call a router just "router", virtual machine "virtual machine" and so on.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
"abc".slice(4, 10) || ""
_and_ check those inputs in one go if needed. substr = "abc".slice(start, len)
raise "wrong inputs" if substr.nil?
just that one feature (only nil and false are falsy) of ruby makes it positively stand out among all the languages that have "null" as concept