I find that more and more new questions consist of useless ponderings of obscure details of languages.
Maybe I am not seeing the questions that involve actual issues. That could be because the obscure useless questions tend to gather the most traction.
A few recent examples (from weekly newsletter):
- Why mixing + and cast does not produce an error in "+(int)+(long)-1"?
- Why are floating point infinities, unlike NaNs, equal?
- Function optimized to infinite loop at 'gcc -O2'
- Is it possible to get 0 by subtracting two unequal floating point numbers?
- What is the size of a boolean In C#? Does it really take 4-bytes?
- Is ++x %= 10 well-defined in C++?
- For a pointer p, could p < p+1 be false in an extreme case?
- Does &((struct name *)NULL -> b) cause undefined behaviour in C11?
- Is ‘int main;’ a valid C/C++ program?
These questions are all of the academic ponderance type. No one actually needs to know this information. They are being asked for the purpose of gathering points.
For instance, is anyone really hitting that brick wall on the +(int)+(long)-1
issue?
In general, "why" questions are not useful. It's the "how" that a real programmer is interested in.
The "infinite loop" question is completely useless. It states, in summary "If I do undefined stuff, how does the compile know what to do?" and the answer is "Who cares?". Of course, the real answer is "It doesn't, so it picks a random outcome", which is the perfect answer to "What happens if I do random stuff?".
The big issue I have with this is that all these are useless questions, as in, not helpful to anyone except the question asker (as they get points).
I could give many more examples of useless questions that get major points, but it's not my intention to bore anyone with lists.
Maybe I'm completely mistaken and droves of coders find solace in the intricacies of +(int)+(long)-1
or it helps them keep their job, solving their hairy +(int)+(long)-1
issues seconds before the deadline.
What I'd like to know is if anyone else has noticed this trend and how they feel about it. It was my understanding the the goal of Stack Overflow (and it's ilk) was to provide useful help to coders so they can code better code that does real things, such as make a boss happy, or a client, or maybe their kid. But how +(int)+(long)-1
will accomplish this is beyond me. I seems to me these kinds of questions are off-topic and should be relegated to the 'compiler quirk ponderers' stack exchange site.
- What about these questions is useful or useless, and why?
- Are they a good fit for Stack Overflow's goal of helping programmers write programs?
- Is it helpful to add these academic questions to the SO archive (i.e. is anyone else actually looking for the answer)?.
+(int)+(long)-1
in code somewhere and wondered "What does this do". Instead, I believe this question exists only to gather rep. In any case, whether it was real code or not, it seems unlikely that anyone will search for this question. At best, it seems to me to be an exercise in language obscurity. That means it is not meant to solve any real problems.