DEV Community

Discussion on: A sorting bug

Collapse
 
nfrankel profile image
Nicolas Frankel • Edited

Thanks for your comment.

I agree, that might have been a requirement. However, this brings two questions:

  1. Why do no comment this strange behavior?
  2. Why would you sort everything, but keep null values in their original location?

EDITED: I updated the code accordingly

Collapse
 
jingxue profile image
Jing Xue

Well, only whoever was familiar with the original circumstances would be able to answer those questions. :-) It could very well have been a bug. I just would have given the original author some benefit of doubt, and assumed that they did what they did for a reason until proven otherwise.

I definitely agree that if this was intended, some comment should have been put in place.