Earlier quoted context omitted.
Exactly [1,2,3,4,5].select{|x| x%2 == 0} If I were interviewing a a Ruby dev, anything other than Array#select indicates lack of experience.
That seems a bit shallow. I’ve been Rubying for 10 years and have always preferred find_all over select. select turns up in other APIs having different meanings (thinking of IO specifically); find_all tells you exactly what it’s going to do. Just my opinion, of course.
Rust for Rubyists
21–30 of 45 posts
Re: Rust for Rubyists
#22> With into_iter(), you take ownership over the vector. After the iteration, the vector will be gone. In Rust terminology, it will have moved.
I stopped reading right there. No Rubist or actually nobody, except real time system developers, should care about ownership.
It makes programming so much more complicated without any real benefit, again apart from real time systems.
Re: Rust for Rubyists
#23> With iter(), you get a "read-only view" into the vector. After the iteration, it will be unchanged. > With into_iter(), you take ownership over the vector. After the iteration, the vector will be gone. In Rust terminology, it will have moved. I stopped reading right there. No Rubist or actually nobody, except real time system developers, should care about ownership. It makes programming so much more complicated wit…
Re: Rust for Rubyists
#24Or every language complicated enough is reinventing lisp partially.
Re: Rust for Rubyists
#25> With iter(), you get a "read-only view" into the vector. After the iteration, it will be unchanged. > With into_iter(), you take ownership over the vector. After the iteration, the vector will be gone. In Rust terminology, it will have moved. I stopped reading right there. No Rubist or actually nobody, except real time system developers, should care about ownership. It makes programming so much more complicated wit…
Re: Rust for Rubyists
#26Earlier quoted context omitted.
Exactly [1,2,3,4,5].select{|x| x%2 == 0} If I were interviewing a a Ruby dev, anything other than Array#select indicates lack of experience.
That seems a bit shallow. I’ve been Rubying for 10 years and have always preferred find_all over select. select turns up in other APIs having different meanings (thinking of IO specifically); find_all tells you exactly what it’s going to do. Just my opinion, of course.
Re: Rust for Rubyists
#27Earlier quoted context omitted.
Or apparently the even more common functional list operations: “map”, “for_each”, “filter”, “every”, etc.
Well, unless your language is "go" in which case it converges on no good package management and no functional filter/map/reduce functions
Re: Rust for Rubyists
#28It's nice to see languages converging on a standard set of features. String interpolation, random number generation, package management, etc.
Re: Rust for Rubyists
#29Earlier quoted context omitted.
If I'm writing ruby I'd prefer Array#select for this task.
That’s an alias for `find_all`.