Douglas Crockford (JSON, JSLint, JSMin, Javascript: The Good Parts) is a founding father of modern Javascript. He is a frequent speaker on the Javascript circuit and, until recently, was the scheduled as the keynote speaker for the Nodevember Conference. For reasons no one can explain, he was removed from the conference schedule to help foster inclusivity. No one (including Crockford) knows why he was banned. Internet commenters have speculated it may have been due to a talk titled "Monads and Gonads" or slut shaming the "promiscuous" web or a his use of the gender (and species) exclusive phrase "hanging out there like a pair of dog balls". Others believe it's because he's a curmudgeon (aka grumpy old white cis heterosexual man). One of the Nodevember organizers (not involved with the decision to ban Crockford) has stepped down.
This is not the first time Crockford has experienced censorship -- he previously ported Maniac Mansion to the NES.
(Score: 3, Informative) by JNCF on Wednesday September 07 2016, @02:23AM
Again, I may not be 100% up on every last idiom or saying, but I would assume that if one is saying that something is hanging out there like a pair of dog balls, one is saying that one finds it to some degree disgusting.
It was that combined with a geometric comparison. Crockford's use of that description was in reference to the tail end of an anonymous function which is wrapped in parens and then immediately invoked, as so:
(function () {
})();
(Score: 2) by tibman on Wednesday September 07 2016, @02:28AM
"Self-executing anonymous function" or "anonymous function with dog balls". I call the curly braces left mustache and right mustache but i don't think i'd call anything "dog balls", lol. I'll try it at work and see how that goes. Guessing not well!
SN won't survive on lurkers alone. Write comments.
(Score: 2) by Bogsnoticus on Wednesday September 07 2016, @07:06AM
If you work with any Brits, then use the term "dogs bollocks", as that is slang for "outstanding" (for obvious reasons).
Calling something "bollocks", just means bad.
Genius by birth. Evil by choice.
(Score: 1) by nitehawk214 on Wednesday September 07 2016, @03:45PM
Never understood that. Bollocks might be good or bad, depending on context. Too vauge.
"Don't you ever miss the days when you used to be nostalgic?" -Loiosh
(Score: 1) by purple_cobra on Wednesday September 07 2016, @05:03PM
There's also the word 'bollocksed' (i.e. broken). And you might hear something called "the bollocks", i.e. having a silent dog, which is even more confusing.
(Score: 0) by Anonymous Coward on Wednesday September 07 2016, @07:46PM
Hmm, not being a Brit, I always thought that "bollocks" derived from "bullocks", something that seems to be know in America as "Truck Nutz". Animal husbandry, doncha know! (BTW, the American equivalent to "dog's balls" would be "the cat's pajamas". Is it always the case that American idiom is less crude than British?)
(Score: 1) by kurenai.tsubasa on Wednesday September 07 2016, @02:37AM
Ah, I see. Yeah, that's a helluva construct. Pretty unique to ECMA/Javascript (in usage).
(Score: 1) by kurenai.tsubasa on Wednesday September 07 2016, @02:40AM
Bah, shouldn't have hit submit so quickly. Sorry to reply to myself. The point of that construct is to create a self-contained scope. It's almost kind of like a class if done properly, but it's not.
(Score: 2) by JNCF on Wednesday September 07 2016, @03:15AM
The point of that construct is to create a self-contained scope.
Yeah, and he wasn't even opposed to the purpose of the construct, he was opposed to the positioning of the brackets. He preferred to wrap the parens around the invocation, a practice I found myself agreeing with:
(function () {
}());
I haven't written JavaScript like that since I started using build tools that allow proper modules -- though those build tools rely on this construct under the hood, so my final production code does use it.
(Score: 2) by jimshatt on Wednesday September 07 2016, @07:33AM
(Score: 1) by nitehawk214 on Wednesday September 07 2016, @03:48PM
Wait, both of the last 2 cases work? I assumed that only the last case worked as that is how I always see it done.
I like the middle one much more.
"Don't you ever miss the days when you used to be nostalgic?" -Loiosh
(Score: 2) by JNCF on Wednesday September 07 2016, @05:17PM
In most real cases, the outer parens aren't necessary. If you change your first example to be the value assigned to a variable, it will work:
var x = function(a) { alert(a); }('sucking eggs')
As for why we would want to add outer parens, it's a matter of human readability. Let's break this example up into multiple lines.
var x = function(a) {
alert(a);
}('sucking eggs')
Now, if you looked at the first line of that function, you could be forgiven for assuming that the value of x is currently a function (though of course x is undefined, since that is the value returned by the function). Let's look at it with parens:
var x = (function(a) {
alert(a);
}('sucking eggs'))
Reading the first line, you should already know that we're going to do something with that function before assigning anything to x.
My only real argument against dog-balls-style is that it sort of undermines and confuses this point, since the parens only actually encompass the anonymous function and the invocation that comes after the end-paren. Looking to the end of the parens, a reader could still assume that x was a function. Of course the invocation is right next to it, not broken off onto another line that's potentially off-screen, and I don't think this is nearly as important of a distinction for readability.
(Score: 2) by JNCF on Wednesday September 07 2016, @06:54PM
My only real argument against dog-balls-style is that it sort of undermines and confuses this point, since the parens only actually encompass the anonymous function and not the invocation that comes after the end-paren.
Fixed that for me.
(Score: 3, Insightful) by stormwyrm on Wednesday September 07 2016, @06:44AM
Numquam ponenda est pluralitas sine necessitate.
(Score: 2) by TheRaven on Wednesday September 07 2016, @08:12AM
sudo mod me up
(Score: 2) by FatPhil on Wednesday September 07 2016, @10:20PM
Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves