News for hackers. Stuff that matters.
Re:Rookies in the Bike Shed by zumda on Tuesday March 27, 2012 @11:35AM (#3762052)
To summarize it: Someone upgraded from Rails 2.3 and had an issue, since xhr? stopped returning a boolean but 0 instead (the regex index of the first match). But he used the return value of that predicate in javascript. In Ruby 0 is truthy, but in Javascript it is false. So he made a pull request to change the behavior back to a boolean instead of 0.

@fxn then said that's not needed, and the predicate did return a truthy value and the contract never specified that it would actually return a boolean, so no contract was broken, so there is nothing to fix. (The Rails documentation uses monospaced "true" and "false" for the singletons and normal "true" and "false" for truthy and falsey values.)

Then Tim Pope suggested an alternative solution that would actually return a boolean. It got merged by @tenderlove but quickly reverted by @fxn again.

And so the bike shedding continued...

Re:Rookies in the Bike Shed by cliftonk on Tuesday March 27, 2012 @12:08PM (#3762272)
It was my pull request. It was spurred by a compatibility break that took all of two seconds to fix in our app, but the principle of the matter is what irked me.

And it wasn't from passing it to JavaScript, it was from parameterization from Ruby to Ruby.

I didn't really care that much about it getting merged in, so long as the docs changed (fxn's argument about using a fixed-width font in html docs to indicate the singleton true vs a truthy value is something that really ought to change). That stance is unfriendly to developers and follows what seems to be the Principle of Most Surprise.

At the end of the day, it's not worth all the trouble for something so trivial. I'd rather rails-core deal with more important issues. And that's the last time I ever send a pull request on principle to a project I don't own.

Re:Rookies in the Bike Shed by fxn on Tuesday March 27, 2012 @11:48AM (#3762141)
Indeed, it took me some 24 hours to revert. I reflected about it for some time.

After thinking about it for a day, I was convinced the commit was sending the wrong message, and felt it had to be reverted. The commit message explains the rationale.

Re:Rookies in the Bike Shed by chc on Tuesday March 27, 2012 @03:40PM (#3763260)
I hate to be harsh, but just to give some perspective: You really come across as stubborn and intractable there. Your rationale basically boils down to "People might think I was wrong if we change this." The reason given is not anything like "The code I am reverting is inferior," it's just "This code doesn't support the point I want to make." You even said that if his commit message had been different — not the code, just the commit message — you would have left it.

Try imagining this from somebody else's eyes — what does it look like?

Re:Rookies in the Bike Shed by fxn on Tuesday March 27, 2012 @03:54PM (#3763313)
I can only say you basically have no idea what you are talking about. I know my motivations, you can't read my mind chc.
Re:Rookies in the Bike Shed by chc on Tuesday March 27, 2012 @04:07PM (#3763361)
That is true, and I'm sorry if it sounded that way. I was speaking from the perspective of interacting with other people, not your inner thoughts. You might actually have had very good reasons why your choice was superior, but you did not share them with anyone else, and from an impartial observer's perspective, it looks like this stonewalling is what made a simple PR turn into a huge bikeshedding flamefest. If this doesn't matter to you, I apologize for wasting your time. It just seemed like something I would want to hear if I were in your place.
Re:Rookies in the Bike Shed by fxn on Tuesday March 27, 2012 @04:46PM (#3763496)
If that was the intention I appreciate it.

Yes it matters to me, but up to a point. I cannot do things in my life seeking approval or saying yes to some people when I am convinced the answer is no.

Also, saying no, and not applying the PR the way I did, with the rationales and respect I showed, should not be taken as an offense. People just get upset when they see the red label "Closed".

On the other hand, for every 24 haters, I can present 24 lovers. It just doesn't matter, one has to do what he thinks is the correct action. Do it politely, but do it.

Re:Rookies in the Bike Shed by bratsche on Tuesday March 27, 2012 @10:59PM (#3764522)
It's more than that though. It seemed really clear that a lot of people thought this was useful, and you blew off all objections without really explaining sufficiently why. It's not that big of a deal, and it sucks that everyone wasted so much time on it, but the thing that bothers me about it is that I (and it sounds like a number of other people) have come away from this still not understanding why the change is rejected. We understand what you wrote about predicates not guaranteeing a boolean, but your attitude kind of implied that predicates should not return a boolean and, clearly, a number of people don't understand why that makes sense.

What you failed to address was why your way was better than returning a boolean true/false. Everyone understood your comments that predicates don't necessarily need to return those, but your comments kind of read like "my way is perfectly valid Ruby" while the other people's perspective seemed to be "our way is perfectly valid Ruby also, and it alleviates some potential annoyances or pitfalls". You never really addressed any of that, it always seemed to just go back to "my way is valid Ruby".

Maybe this wasn't really your intention, but it honestly seemed as though you were deliberately trying to frustrate people. I think that's why there was so much push-back (in the form of about three other PRs being opened). Not because people felt so strongly about xhr?, but because it just seemed like you were just rejecting everyone's opinions without really expressing why returning true/false is worse than returning 0/nil.

I'm basically a total outsider since I haven't contributed to Rails yet, so feel free to completely ignore my perspective.

Re:Rookies in the Bike Shed by nateware on Tuesday March 27, 2012 @05:48PM (#3763693)
Yes, good point - all the more reason to be mindful of the impressions you make on others, since their perception is their reality.
Re:Rookies in the Bike Shed by neerajdotname2 on Tuesday March 27, 2012 @04:17PM (#3763396)
Thanks for not allowing code convention to be based on mob psychologoy.
Re:Rookies in the Bike Shed by zumda on Tuesday March 27, 2012 @12:30PM (#3762382)
Ah I'm sorry, I should have rechecked before posting this. I meant no offense.

There you see how closely I follow this story... :)