34

First I noticed it some weeks ago when the question for the functionality of !-- operator in JavaScript was posted. I mean I don't even really know JS and could easily tell that this is a not operation on an predecremented value.

And I bet any decent programmer could do so, too.

But this generated until today already a score of 215... (the post has a young age of exactly 2 weeks while writing.)

Same day there was another HNQ about what <<~ does, which as well got close to 50 upvotes.

As well as a question for !!~ where the OP explains that he knows it is just a combination of !(!) and ~ And then asks, why this "operator" is even implemented(?)... and again almost 50 upvotes.

Then scoring over 1000 (steady growing) with the question for the !! operator...

And after seeing again on HNQ today: "What does +!! operator do?" I was already sure this will belong to JavaScript again, when I was clicking it... and I was right... and of course the score was > 10 already again.

Finally my question is:

How does it come that the JS community is giving such high scores to posts, which I personally even would tend VTC as showing no effort and being easily self-answered by doing minimal research? Could there be some voting-fraud ongoing? Or are JS users just pretty mesmerized by combining known operators and experiencing the logical outcome?

EDIT

To clarify my ambition of asking:

I'm disturbed by these questions becoming even pushed by being part of the HNQ everytime (at least that's what it feels).

I understand that it's worth to have them around, and also that not everyone knows how to workaround punctuations.

I even could tolerate the "like"-votes.

But being HNQ it's absolutely not worth.

16
  • 23
    It is entertainment, it has little to do with useful Q+A. The dictum that we are not allowed to have fun is widely ignored, vehicles like the Hot Network Question list, the news letter and various aggregator sites bring in the views. Votes follow. Dec 29, 2015 at 14:16
  • 1
  • 1
    @BoltClock: Whats it related to?
    – dhein
    Dec 29, 2015 at 14:33
  • Have put up a honey-pot question to test your theory at stackoverflow.com/questions/34513787/….
    – user663031
    Dec 29, 2015 at 15:11
  • @torazaburo: stackoverflow.com/q/1642028/2003898 honeypot related.
    – dhein
    Dec 29, 2015 at 15:18
  • 5
    @torazaburo It's not really a controlled test of the theory when you link to your post in a meta question that openly criticizes this type of question. All you're testing is whether the meta effect is stronger than the HNQ effect. Dec 29, 2015 at 16:45
  • 3
    @ThisSuitIsBlackNot Indeed, I must have skipped my experimental design class that day.
    – user663031
    Dec 29, 2015 at 16:46
  • If there was never a question about those things, are the chances higher or lower that an average user would learn about them?
    – user4639281
    Dec 29, 2015 at 17:38
  • The big problem is it is hard to search for operators when you have no clue what they are called. Dec 29, 2015 at 18:11
  • 8
    It's not high-quality. It's just popular. And JavaScript has as much as many non-decent programmers as, say, PHP. Personally I just did downvote the post.
    – Bergi
    Dec 29, 2015 at 18:59
  • 5
    "Being HNQ its absolutely not worth." Indeed. But the algorithm cannot detect quality, it just detects popularity - and boosts it.
    – Bergi
    Dec 29, 2015 at 19:01
  • I personally even would tend VTC as showing no effort and being easily self-answered by doing minimal research those aren't valid close reasons (though you can downvote for whatever you wish, including that). You should only vote to close if it falls into one of the predefined reasons.
    – mason
    Dec 30, 2015 at 20:25
  • @mason: well, showing no effort for solving the problem is a reason to flag as off-topic. And I got adviced that I should VTC if I can isntead of flagging. So why it isnt valid for VTC if its an predefined flagging reason?
    – dhein
    Dec 30, 2015 at 20:33
  • 1
    @Zaibis Which VTC reason does "showing no effort" fall under?
    – mason
    Dec 30, 2015 at 20:35
  • 2
    @TessellatingHeckler Downvoting and voting to close have different criteria. They are not the same. You can downvote for any reason you wish, as long as you aren't serially downvoting someone. If you want to methodical about your downvotes, then you'd use them to encourage good behavior and discourage bad behavior (of which, showing little effort is bad behavior). But voting to close does not have a "shows no effort" reason because we specifically do not want that. Do not shoehorn it into "Other" (which should be reserved for exceptional circumstances). Vote to close based on reasons provided.
    – mason
    Dec 30, 2015 at 21:04

5 Answers 5

19

Or are [users] just mesmerized

Yes. I call those user's votes "likes" instead of "upvotes", then it all makes some more sense.

This is not unique to JS, nor to operators. In my opinion, these questions address gotchas that the average developer won't necessarily ever encounter, but are "fun" to read about.

Such votes are cast on almost any subject that may be interesting, but not necessarily a high-qualty post where the question and answers will potentially teach you anything that you can use in your programming career.

I see those users go "Wow, I didn't know that" and upvote.

I don't think questions like this are actually bad content (i.e. downvote-worthy), but neither do I deem them worth triple-digit scores and a newsletter spot...

9
  • 3
    Such posts seem to meet the description of downvotes pretty distinctly. Poorly researched and not useful. Why wouldn't you downvote them?
    – Servy
    Dec 29, 2015 at 15:33
  • 1
    @Servy because the question or its answers contain useful content that is on-topic. This all starts with asking the right question. Sure, it may be poorly researched, but it does improve the site as a whole, granted the question is real and unique.
    – CodeCaster
    Dec 29, 2015 at 15:35
  • 2
    But it's not useful information, or at a minimum, it's not adding any value as whatever useful information that's there is already readily accessible in the language's documentation of those operators. Repeating that information isn't useful. If there was literally no place in the whole internet describing what the greater than, less than, decriment, etc. operators did, then sure, it'd be useful, but that's obviously not the case.
    – Servy
    Dec 29, 2015 at 15:38
  • @Servy I catch your drift, but "it's in the manual" was never a valid reason not to post on SO, AFAIK.
    – CodeCaster
    Dec 29, 2015 at 15:39
  • 2
    Of course it is. And it's certainly a reason to downvote. Why so many people think that wasting their time re-creating the documentation is anything but wasting the time of everyone involved is beyond me.
    – Servy
    Dec 29, 2015 at 15:42
  • So you think that it merits a downvote, but you don't downvote anything because of reasons, so you don't think this merits a downvote because nothing merits a downvote? You've got a bit of a contradiction there. The fact that the vast majority of the content is bad content doesn't mean that we should pretend that it's actually good content, just to make ourselves feel better. And of course you're not just saying you don't bother to downvote, you're encouraging other people to not downvote the bad content.
    – Servy
    Dec 29, 2015 at 15:49
  • @CodeCaster I don't think questions like this are actually bad content - I agree. It being not-bad content doesn't necessarily mean it fits well on SO, though... ie, it could still be off topic. Though, these types of questions, whether strictly on-topic or not, are not detracting from the site as a whole.
    – Reed
    Dec 30, 2015 at 20:28
  • 2
    @Servy, it's not adding any value [beyond the documentation]. Repeating that information isn't useful. - I boldly disagree. Haha. Dupe questions are repeated information, yet they are kept and made canonical, rather than deleted. It's easy to miss small things when reading documentation, and often hard to find them if searching. Having it on SO makes it easier to find (and discuss).
    – Reed
    Dec 30, 2015 at 20:32
  • 1
    @Jakar Having things phrased differently to help people find it is quite useful. Even the simplest questions helps people turn documentation into practical knowledge. Besides, if the documentation was so good, why would they be spinning up "Documentation?"
    – Booga Roo
    Dec 31, 2015 at 13:53
35

Then scoring over 1000 (steady growing) with the question for the !! operator...

Funny story... Years ago, I was showing some code I'd written to a co-worker, and they stopped me and asked about the use of !!. They'd never seen it before; they didn't understand what problem it solved, or why I would solve it in that way.

It's an idiom; once you're used to it, it's hardly notable... But if you've never seen it before, it'll stop you cold. And because it's an idiom not an operator, you might well read your reference manual diligently and never encounter it.

So yes, there's value in having questions that explain idioms.

13
  • 22
    "And because it's an idiom not an operator" BUT IT IS TWO OPERATORS ANYONE WITH EVEN THE MOST PRIMITIVE KNOWLEDGE OF ONE OPERATOR SHOULD HAVE NO TROUBLE FIGURING OUT TWO OF THEM twitch
    – BoltClock
    Dec 29, 2015 at 16:53
  • 5
    Heh... Sure, just like anyone with a dictionary should be able to figure out what I mean when I say JavaScript is often the dog in a manger.
    – Shog9
    Dec 29, 2015 at 16:56
  • 6
    Wait... isn't JavaScript a hamster?
    – BoltClock
    Dec 29, 2015 at 17:00
  • 4
    @BoltClock Not necessarily, once you factor in type conversion. In the Java world for instance, !! is totally useless, and if someone showed me that code I would definitely ask what they meant to do. In the JavaScript world, it's actually not obvious to me (as a Java programmer) how !!foo is different from just using foo in a boolean context -- that is, how if (foo) can differ from if (!!foo). If there aren't differences, why would you ever do !!? And if there are differences, they rely on subtle points of JS's !, which may be worth calling out.
    – yshavit
    Dec 29, 2015 at 19:15
  • 7
    Then why don't we have questions asking what function f(x) {return x < 0 ? 0 : x;} does, and a separate one asking what function f(x, y) {return x < y ? y : x;} does, and a separate one asking what function f(x) {return x > 0 ? x : 0;} does? Because programmers are expected to be able to understand how the pieces work together!
    – user253751
    Dec 30, 2015 at 1:39
  • 5
    This basically sums up my feelings on the matter. I am always mildly surprised in these meta posts that humblebrag about what OP considers basic. You mean you can easily understand that piece of code but can't figure out that their are hundreds, thousands, maybe millions of people who know less than you? My advice is get used to seeing things you consider easy get heavily upvoted because they are helping a lot of people. Dec 30, 2015 at 1:48
  • 4
    Dear @immibis, please look up the definitions for the words I use in this answer and put the pieces together. Thanks!
    – Shog9
    Dec 30, 2015 at 1:48
  • 1
    @immibis Slightly less flippantly than Shog9's response is: because those questions haven't been asked, or if they have, they haven't been upvoted. In other words, because people haven't found them as helpful as questions about !!. Yes, this means there's some mushy, subjective line at which people generally find things non-trivial enough to be interesting. There's a way to measure that subjective mushiness: votes. So rather than assuming that your examples are equivalent to questions about !!, you can form that hypothesis, and then test it by looking at votes. (Spoiler: they're not.)
    – yshavit
    Dec 30, 2015 at 2:43
  • @yshavit: That's exactly the point Bill the Lizard was trying to get across to Servy. Unfortunately, it would seem it was lost on him.
    – BoltClock
    Dec 30, 2015 at 3:26
  • @BoltClock Did my sarcasm radar fail on your original comment? :)
    – yshavit
    Dec 30, 2015 at 3:29
  • 1
    @yshavit: My excessive use of caps might just have broken it, sorry ;)
    – BoltClock
    Dec 30, 2015 at 3:36
  • 2
    Bear in mind that many JavaScript coders have learned their craft by cargo-culting and consulting such bastions of erudition as W3Schools and may have never studied properly-structured documentation of the language...
    – PM 2Ring
    Dec 31, 2015 at 12:46
  • @BoltClock you mean that the == operator just performs two assignments?
    – GolezTrol
    Jan 1, 2016 at 11:41
15

Why is asking for operators functionallty high-quality content within javascript community?

Because you can confuse many people with them. Shog and Codecaster are right, in their own way. But this shed lights into a more profound problem than what seems to be, which is the lack of a simple skill that I believe all real programmers should have:

The ability to separate a big problem into smaller ones and apply workable solutions which, working in concert, solve the big problem.

You see this everyday on SO in general. Spaghetti code, lack of debugging attempts, and lots of votes on questions about seemingly simple pieces of code. So, when people see !! they don't see two !, they see one entity called bang-bang (!!). Sadly, this is something we cannot fix.

7
  • 1
    Again, I want to stress that !! is a bit more than the sum of its parts... After all, logically "Not-Not" is a No-op. But read the answers... Note that I started using this in C++, not JavaScript, after getting caught out by some fragile library code that assumed it could do direct comparisons between booleans.
    – Shog9
    Dec 29, 2015 at 18:31
  • 2
    @Shog9 I had read the answers before even writing this, thanks. I still think !! is a sum of it parts, given the (ab)use of the behavior of the not operator.
    – Braiam
    Dec 29, 2015 at 18:34
  • 1
    You're making a value judgement on others' style. Which is fine, but also irrelevant and potentially dangerous if you force your opinions on others: if I, as a new coder working with an old codebase, miss the implied behavior and remove the "redundant" operators... Things may break in very hard-to-find ways.
    – Shog9
    Dec 29, 2015 at 18:35
  • @Shog9 which is why we have code standards no? To have a universal language.
    – Braiam
    Dec 29, 2015 at 18:40
  • 2
    Yeah... Shall we continue this conversation in lojban?
    – Shog9
    Dec 29, 2015 at 18:41
  • @Shog9 I forgot my flashcards :(
    – Braiam
    Dec 29, 2015 at 18:58
  • 1
    @Braiam: Not everyone enforces code standards, let alone having them.
    – BoltClock
    Dec 30, 2015 at 3:31
12

I am the one who posted the question that is being talked about (+!!).

I agree that there was nothing special about the question, and a lot of the upvotes could be considered 'likes'. If it was in a newsletter and it annoyed people, I apologize.

This is mostly directed at the negative comments towards my question and others like it, rather than the OP's question. I just wanted to give my perspective.

The fact that I was reading someone else's code to understand it should help show a willingness to research. I ran into something I didn't understand, searched Google and SO, and didn't find anything. I wanted to understand it. I didn't know what to call it, and didn't realize that +!! was actually + ! !. Researching can be difficult when you don't know the proper terminology. To me it doesn't seem harmful and I believe it was on topic. Obviously others found it helpful in some way. While I realize that the voting system isn't perfect, and I probably didn't deserve all of the upvotes, I don't understand why my question was downvote or close worthy.

I have a much better understanding of this these operators now, and better understand how I need to research things like this in the future.

3
  • Well, I didn't VTC, and I thank you for your perspective. It wasn't critic in you but in the HNQ. while here now I got explained it is just not better to arrange. I downvoted it because in my view one could get this by his own research without getting explained that this are just simple operators connected to each other. In my personal point of view its also not worth having them arround. but they are valid within the site restrictions. So thats why I said it is tempting me to VTC, but I actually not did.
    – dhein
    Dec 30, 2015 at 17:26
  • For the future: when you search for code, try a search engine that search what you input as is, SymbolHound seems to be the only one that does.
    – Braiam
    Jan 1, 2016 at 21:10
  • Googling this sort of thing is pretty difficult, so I totally see why the question was a) asked, and b) popular. Sep 14, 2017 at 8:48
6

How does it come that the JS community is giving such high scores to posts, which I personally even would tend VTC as showing no effort and beeing easyly selfanswered by doing minimal research?

How do you research questions about the !-- operation in JavaScript? Google doesn't seem to give me any results, since it filters out what it sees as punctuation. This is a common problem in many programming languages, not just JavaScript. I think it is worthwhile to have these types of questions on Stack Overflow, and I don't mind that they tend to get a lot of upvotes. I just wish they were a little easier to find through search engines.

20
  • 5
    Have you tried "U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS"?
    – BoltClock
    Dec 29, 2015 at 14:12
  • 3
    @BoltClock Google gives me a bunch of results about HTML. It must think I'm you now. ;) Dec 29, 2015 at 14:16
  • 8
    Researching these questions is trivial. One merely needs to search for a list of operators (even complex languages won't have a long list at all) and find the relevant operator(s) on the list. And of course, if you're asserting that they won't be found in google when searching for the text of the operator then having the question doesn't solve that problem at all. Given that your whole premise is Google isn't finding any of the many sources on the subject, adding yet another source that won't be found does nothing.
    – Servy
    Dec 29, 2015 at 15:36
  • 5
    @Servy I don't see any of the examples in the question in MDN's Expressions and operators, so I think "trivial" might be overstating your case a little bit. Having an explanation about what these operators do in conjunction must be useful to some people, or they wouldn't be getting upvotes. Dec 29, 2015 at 15:41
  • 6
    @Servy So, first you say "even complex languages won't have a long list at all." Then suddenly the list of combinations is too long to document? Who's being a troll here? Don't bother to reply. I can already see where this is going. Dec 29, 2015 at 15:50
  • 7
    The list of operators isn't long at all. The list of every combination of all of those operators is infinite. Each individual operator can be trivially looked up; that's more than good enough. If some combination or operators actually had a particularly notable behavior that's not readily apparent by simply looking up the definition of each component, then perhaps there'd be something worth discussing, but that's not what's going on here.
    – Servy
    Dec 29, 2015 at 15:52
  • 6
    @Servy That is exactly what's going on here. A handful of operators working in conjunction do have unexpected behavior. Example !!. Just because you already know what it does doesn't make it trivial. Dec 29, 2015 at 15:53
  • 1
    So you think that if someone knows what it means to NOT something, they' wouldn't understand what it means to NOT it twice? Knowing what it does does make it trivial. There's no unexpected behavior here.
    – Servy
    Dec 29, 2015 at 15:56
  • 10
    @Servy Oh, so you don't actually know what that does. You should look that up. Dec 29, 2015 at 15:56
  • 2
    I wonder if SO can change its algorithm for generating slugs, so for a question like "what is the --> operator" it generates a URL like "what-is-the-minus-minus-lessthan-operator"?
    – user663031
    Dec 29, 2015 at 16:23
  • 5
    @Bill the Lizard: "You should look that up." Oh dear. What have you done?
    – BoltClock
    Dec 29, 2015 at 16:50
  • 5
    This actually works, though it'd be nicer if a title search would find it, since right now there's nothing to help folks who start typing yet another question on the same pattern.
    – Shog9
    Dec 29, 2015 at 16:50
  • 1
    See, we just need more people obsessively marking up key phrases as code...
    – Shog9
    Dec 29, 2015 at 16:58
  • 2
    Exactly the same way you'd research just ! or just -- - i.e. by opening "operators" section in manual? (It is just to point you won't find anything useful by googling javascript -- too). Dec 29, 2015 at 17:20
  • 2
    @OlegV.Volkov That's true, but for individual operators Servy is right. You can just find the operators doc for your language and Ctrl-F for the one you're looking for. (Not ideal when you're used to just Googling for things, but it does work for every language I've tried.) Dec 29, 2015 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .