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.
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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I think that ordered list means ordered by ascending value (i.e 1,2,3,4....n) so -1, -2, -3 would never be a series in that list. Because -2 is less than -1 it would be -3,-2,1
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.
Hey guys, i see that this has a best practice on it. Although it is clever and on one line, it seems quite difficult to understand by just reading it.
Am i missing something?
How much memory does one call of this use?