Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Relax... note that I was disagreeing that anyone should be fired for writing code in this style.
If it's causing that much offense, I'm deleting my comment.
In short: nobody cares about your opinion.
In long: There are a dozen reasons why someone considers something best practice, and the classical UUN (aka "unreadable, unmaintainable and not for production") argument is the worst excuse to object to other's reasons why they think a solution is "best practice".
And guess what? Most good golfers are also very good at learning, re-iterating, and writing clean, concise code with their language too because golfing actually takes effort. Now if you're really a "newcomer", I hope you don't hold your attitude like this for the rest of your life, because that means you aren't even learning, and it'd be the real terrible thing. I wouldn't even need to take a guess who is more capable.
Comment deleted because it might have upset someone
TLDR: Agreed with Smudge that no one should be fired just because they code in this way, but expressed agreement with the sentiment that I don't find it great for readability. YMMV. It was just my opinion.
This comment is hidden because it contains spoiler information about the solution
I don't disagree, but I hope you're not actually serious. Firing someone for an incomprehensible (albeit clever) one-liner seems particularly petty. If the developer truly doesn't understand the need for readable production code, there are plenty of ways to teach that lesson without taking extreme measures.
You are totally correct, This is not best practice at all! If someone put this in production code I would have them fired unless they refectored it immediately.
I don't think you are. I would upvote this for cleverness but not for best practice. My initial feeling is that the main culprits damaging readability are the blocks passed to sort_by and inject. If you pulled those out into well named lambdas, they would better self-document what's going on inside those blocks.
Experimented with this here: http://www.codewars.com/kata/reviews/51e056fe544cf36c41000102/groups/53840a80aa6fc153e50002e3
Don't know that it's better.