I find it funny when a linter wants me to use .zero? as its so highly specific and odd to me. .positive? seems a bit more natural to me along the same lines.
Rails provides .first, .second, etc. up to .fifth for arrays and collections. In a trolling fashion, it also has .forty_two, which returns the forty-second element.
Hah! That really does come off like a "screw you yes we did this".
I'm a huge fan of the wide variety of messages you can pass, but it does seem like it will take a while to learn everything that's available. They seem to lead to very readable code.
/developer|entrepreneur/i
Always looking for new developer talent, even those with zero experience, as you never know who's got the potential to become a great developer.
A big love or hate with Ruby are the methods that objects have like...
I find it funny when a linter wants me to use
.zero?
as its so highly specific and odd to me..positive?
seems a bit more natural to me along the same lines.Rails provides
.first
,.second
, etc. up to.fifth
for arrays and collections. In a trolling fashion, it also has.forty_two
, which returns the forty-second element.Hah! That really does come off like a "screw you yes we did this".
I'm a huge fan of the wide variety of messages you can pass, but it does seem like it will take a while to learn everything that's available. They seem to lead to very readable code.
There used to be more of these whereupon there was debate, and ultimately a cull.
#forty_two
is an artifact of that, if you can call it, process.