16

Q: How do I get the number of items contained in a Java ArrayList?

A: Look at this link it will help you a lot http://www.url.com/to-get-the-number-of-items-in-an-arraylist-use-its-size-method.html

This is an archetypical link-only answer, but should it be deleted? The correct answer is right there in the URL slug text!

I realize this is an edge case, but I saw something like this and couldn't decide what the proper action should be. I can't find it anymore — probably deleted. So I made up the above contrived example.

Maybe just "improve formatting"?

A: To get the number of items in an ArrayList, use its size method.

4
  • 4
    From my point of view, if the answer is correct even after the linked resource cease to exist, it is a valid answer. But I almost never saw this.
    – lexicore
    Commented Nov 11, 2014 at 9:01
  • 15
    what if linked page content contradicts? Say, the title is like "To get blah blah use its size method?" (question mark is lost in slug) and opening sentence at the page is like "No way!" or "Avoid this" or "This won't work"
    – gnat
    Commented Nov 11, 2014 at 9:06
  • 9
    @gnat Skilful countering of an improbable edge case with an even more improbable edge case.
    – Mark Amery
    Commented Nov 12, 2014 at 21:55
  • Reminds me of a famous SNL sketch... Commented Nov 12, 2014 at 23:17

1 Answer 1

16

Personally, I'd probably recommend deletion on something like that.

For example, this looks like an answer

to get the number of items in an array list, use its size method

whereas

Look at this link it will help you a lot http://www.url.com/to-get-the-number-of-items-in-an-arraylist-use-its-size-method.html

is just a link only answer.

In the official NAA thread, you can see how the first one is an answer. It doesn't show what to do in cases like this though.

If the answerer had the attention of leaving an actual answer and not just a link, they would likely leave something like the first one. The second one just appears to point the questioner to another website where the answer can be found. Just in this case, the url slug possibly happens to be an answer by itself, which could likely just be a coincidence.

I'd have no problem with people recommending deletion on these and leaving it up to the answerer to improve their answer. However if you feel that the url slug is an answer, you can always just edit it for the answerer. Where they can then choose to rollback if that's not what they meant or hopefully improve after they see your edit.

7
  • 1
    if the answer is not simple I guess this works, but would you advocate editing the answer from the link into the answer if the link just showed a simple function such array.size() to bring the information on SO? Commented Nov 11, 2014 at 9:54
  • 4
    @Stacker-flow Most times when questioners are looking for what function to use, the answerer will say something like use .size() .. so this is clearly an answer. Whereas see this link http://www.url.com/to-get-the-number-of-items-in-an-arraylist-use-its-size-method.html is not directly saying to use the size function. Maybe there's something else on that page they wanted the questioner to look at. But yea, if you think its what they meant, to use the size function, then just edit it.
    – CRABOLO
    Commented Nov 11, 2014 at 9:58
  • 3
    "Recommending deletion" just because you don't like the formatting is like burning down the house because you don't like its color - pointlessly destructive. Take a big step back and thing about what actually creates a useful site. Commented Nov 12, 2014 at 21:14
  • 1
    @ChrisStratton Formatting is not the issue here. The issue is content and whether it is accessible to viewers on SO. Commented Nov 13, 2014 at 1:19
  • 1
    @JasonMArcher If the answer can be easily made into something useful, deleting it would be a bit too hard.
    – glglgl
    Commented Nov 13, 2014 at 7:55
  • 1
    That is untrue, Jason. It has been established here that if the url were not a url but simply text it would be an answer. And that is merely a formatting difference. Even if the link is dead, the url itself is a human-readable answer. Incidentally, this is why third party edits to hide link urls can be destructive. Commented Nov 13, 2014 at 13:28
  • 1
    If you read the discussion, titles to articles are not always accurate or strait factual statements. So you need to consider the URL to be unintelligible. Even if it does happen to contain the answer, it is still a link-only answer and against the rules. If you as an editor want to take the time to fix the answer, that is great. But we still have a problem post that needs to be dealt with. Commented Nov 13, 2014 at 17:49

You must log in to answer this question.

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