-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Both grep and greplace! use "heisenparameters" #5
Comments
With the demise of crossclj, I'm not sure how to identify downstream consumers of the library. If anyone knows of other tools or sites that provide this kind of information, it would be most welcome! |
I threw together a little tool that allows one to determine this, at least for projects hosted on Clojars. Running user=> (get inverted-dependencies "clj-commons/multigrep")
nil
user=> (get inverted-dependencies "org.clojars.pmonks/multigrep")
[["org.alfrescolabs.alfresco-technical-validation/org.alfrescolabs.alfresco-technical-validation" "org.clojars.pmonks/multigrep"]] i.e. there's only one Clojars-hosted project that's using this library. |
As articulated by Stuart Sierra, the use of function parameters that may either be collections or singletons is an anti-pattern, yet that's exactly how
grep
andgreplace!
are implemented, for exactly the reason the article decries (convenience).Although the fix is technically trivial, it does break backwards compatibility, so this will require some research to try to identify downstream users of the library, and then outreach to those projects' maintainers to ask them whether this fix is worth the pain it will inflict on them.
The text was updated successfully, but these errors were encountered: