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
Clarify differences between .head and .first #2961
Comments
|
If you just want the first thing in the list, I don't think there's anything wrong with using The reason the two exist is because Personally, I feel Thus, from a language point of view, I don't see a problem, and from a documentation point of view, I don't think it's worth spilling much ink trying to advocate one over the other, especially when I don't think there's any consensus on which to advocate. :-) I'd rather any more words spent in the docs go on pointing out - if not already done so - that |
|
@JJ, feel free to do whatever you want here. Maybe it'll make sense to open a new ticket in the doc repo (so that we still have the decision in this repo in case it comes up again). |
|
I can move it to the doc repo. Maybe it's the best thing. Changing or deprecating a feature is a big thing, but we can just document it better (maybe as a trap) so that they are known and used properly. |
|
I agree with @jnthn, closing ticket. |
Sometimes I use
.firstwhen I mean.head, just because I confuse them often. Example:It made me wonder if I'm not the only one, and indeed:
\.first;68 lines, 36 modules: https://gist.github.com/9293e27affd6d158e897650fa9584b02Moreover, people often use
.grep().firsttoo (when they can just usefirstinstead):grep.*\.first;18 lines, 13 modules: https://gist.github.com/b8cc1f7fdbce9163c0a3e7b5a9467710I think there's something wrong when a specifically dedicated feature is not being used. That being said, I don't see any downside in using
.firstinstead of.head…The text was updated successfully, but these errors were encountered: