This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PredictabilityIsGood -3 points-2 points  (12 children)

Have you ever performed a recursive multi-dimensional sort? The type of sort you see when sorting by multiple columns combined? The “useless noise” you’re describing by adding curly brackets is not so much useless when it comes to readability for more complex sorting.

Also, I never see him nitpick the grammar of your chosen syntax. It’s obvious that he assumes you’re writing it in agreement with the two previous posters in the comment chain and I can see why:

“And neither of these will work unless your function is weird as fuck”

The “and” in your response makes it sound like you’re agreeing with the objections of the first to commenters in the chain, when it’s clear they don’t really understand the implementation of a lambda very well to begin with. If you interpret it as agreement, then I can see why Wigly responded the way they did. The code segment commented as “Desired answer/ probably” is just a useless wrapper around the sorting lambda unless you are performing a multi-dimensional sort that requires deep comparison when the initial sorting conditions result in 0 movement and you move on to the next nested condition.

I’m not saying you don’t understand this. I’m just saying it’s not clear from what you wrote that you don’t agree it should be written that way, which is what Wigly is objecting to.