5

As I've hinted at in a question (Loading QgsComposition from template without throwing "QgsComposition constructor is deprecated"?), changes in the PyQGIS API don't appear well documented/easily googleable. I've come to this site frequently as I learn more about the API, but I've noticed that some code in questions, and answers is out of date with respect to changes in the API that happened in 2.4. (I'm not sure what else has changed beyond QgsMapRenderer and the QgsComposition constructor...)

Should we be making sure that questions, and answers, specify their version?

Can we do more though, since some of these questions (and answers) are the highest voted in the pyqgis tag, so people will naturally be guided towards them first?

  • to further add to the confusion: methods appear to be exclusively available within QGIS and don't work in standalone scripts – raphael Dec 28 '16 at 23:02
11

In my opinion, answers should specify the version they are written for. If the API changes over time, an update to the answer or a new answer should be added to point out the API change.

I'm not a friend of having ten copies of the same question for ten QGIS versions because it makes it impossible to find and maintain answers.

  • For an answer such as this one where the deprecated part is about 8 lines in the middle, would you recommend editing the answer and modifying those 8 lines. Adding the updated 8 lines below the full block of code, or write a new answer with most of that original code ? – raphael Dec 30 '16 at 19:46
  • 1
    @raphael I would recommend writing a sentence at the beginning which says that "from comments by various users this answer works at 1.8 but not 2.4, 2.8 and 2.10". You can use content from that answer to start a new answer which applies to particular cited versions. If you think the 1.8 answer is no longer useful (perhaps almost no one uses that version nowadays) then you can consider downvoting it to try and prevent it being opened and read first (which wastes the time of most readers). – PolyGeo Jan 1 '17 at 21:08
  • @PolyGeo thanks for the suggestion – raphael Jan 3 '17 at 16:23
4

Should we be making sure that questions, and answers, specify their version?

If questions are version specific, then yes. That is why we have version tags for software and programming languages, such as for example: , , , , etc.

From an answerer point of view, I see no problem providing an up to date answer in version y to a question about version x, as suggested by @underdark. In this case, it is important to emphasize/specify the new answer will work with version y.

On the other hand, from an OP's point of view, a new question could be asked if the OP is interested in version y, but found no questions or answers about it within the site. It would be counterproductive if OPs (especially to new users who still lack reputation and privileges) had only the option to put bounties in questions of version x asking for answers in version y.

Side remarks about voting:

  • I strongly disagree downvoting an (partially or entirely) outdated and (once) useful answer, just to make sure a new updated answer will move faster to the top. In my opinion, it shows lack of appreciation on our part to responders. Instead, just edit the outdated answer to emphasize it is limited up to x version (example), and upvote the newer answer which deals with the y version. One example within GIS SE is:

Showing arrowheads in line end using QGIS?

The answer emphasized which version it is for, and pointed toward answers which work with other versions.

Then, searching for the most suitable answer is easy; especially nowadays we have few answers by question due to no longer accepting 'too broad' or 'primarily opinion-based' questions (without counting it is possible to filter answers within questions by activity, age and votes).

  • 3
    I agree with your final point about voting, doesn't seem fair to the answered if the answer was good, a comment/edit should highlight that it's out of date – raphael Dec 29 '16 at 15:42
  • @raphael it's about the content (not the answerer, their feelings or their rep) so if an answer is [now] not useful (for whatever reason) then downvoting is being applied as per its on-hover tip. – PolyGeo Dec 29 '16 at 20:34
  • Using a bounty is not the only option available to new users when they need better/up-to-date answers to previous questions: meta.gis.stackexchange.com/a/4011/115. As experienced users we often alert them to their other options. – PolyGeo Dec 29 '16 at 20:45
  • That post is for duplicates, i.e., when there is a previous question exactly equal an OP would like to ask. If an OP feels like the version is relevant to get a functional answer, I think a bounty would be the only effective way besides posting a new question. @PolyGeo – Andre Silva Dec 29 '16 at 21:42
  • To me the same question for a different version is a form of duplicate. On the other hand a question that details how they have tried the answer to what seems like the same question and it does not work would be valid, and once answered could be merged with the original to provide another answer there that caters to the newer version(s). – PolyGeo Dec 29 '16 at 21:50
  • 1
    This is it. If the version is key information that a question will require a completely different answer from other version, it is not a dupe to me. That is why I think version tags should only be applied if they are relevant to getting answers. About merging, I am not sure. Because I think there can be many borderline cases. @PolyGeo – Andre Silva Dec 29 '16 at 22:09
  • 2
    I guess I see this as relatively clearcut i.e. same question, different version => single canonical question with answers catering to different versions. Teasing out a question to resolve why another answer may be needed is just an interim tool to being able to collapse them back to a canonical Q&A. – PolyGeo Dec 29 '16 at 22:16
  • My thoughts on this are aligned with MattWilkie's opinion in: meta.gis.stackexchange.com/questions/22/…; which is consistent in other communities I participate. The version can still be expressed in the body though. @PolyGeo – Andre Silva Dec 30 '16 at 7:45
  • But that was only in a 6.5 year old comment on an answer to a question about version tag formatting not version tag use. Mentioning the version in the body is more important than using a version tag. The latter is nevertheless useful just not as much. – PolyGeo Dec 30 '16 at 7:53
  • @PolyGeo, the comment is about version tag use. I went over that question again, and in my opinion its content makes an answer in itself, because it already brings the arguments supporting the status-quo of SE system about using version tags (and it is the most upvoted post among question and answers). But I wrote an answer to emphasize arguments there, together with arguments from other posts in GIS meta, and from other SE communities as well. – Andre Silva Dec 30 '16 at 14:19
  • The view you cite as being the status quo for SE sites is certainly challenged by @blah238 who uses the examples of SuperUser and ServerFault. – PolyGeo Dec 30 '16 at 21:30
  • @PolyGeo, have you clicked in the link where he makes the claim about ServerFault? It shows nothing. I guess you are using two weights and two measures trying to make a point – Andre Silva Dec 30 '16 at 21:55
  • I think @blah238 provided that link to take us to Server Fault so we could see for ourselves. – PolyGeo Dec 30 '16 at 22:10
  • Let us continue this discussion in chat. – Andre Silva Dec 30 '16 at 22:38
3

I agree wholeheartedly with, and have upvoted, @underdark's answer but would like to respond to:

Can we do more though, since some of these questions (and answers) are the highest voted in the pyqgis tag, so people will naturally be guided towards them first?

A QGIS example of this is Transferring custom QGIS settings from one computer to another? (one answer says the rest are outdated)

If a post that uses outdated functionality from an old and rarely used version, making it now much less useful, is at or near the top, then the way to revise its ranking for future searches is to downvote it (and upvote any posts which in your opinion do remain useful and worthy of a higher ranking to help the community find them). This will often trigger its author to update their answer to share their current knowledge creating a "win-win" for the author and the QGIS community. The initial dip in the poster's reputation can then be expected to result in a big boost when its usefulness is not just restored but enhanced.

If the top answer on a question is outdated but remains in top slot only by virtue of it being accepted, perhaps by a user who is no longer active on the site, then there is not much that can be done now, but to try and prevent that being the case on into the future you could vote for Keeping special status for Accepted Answers without sticking them to top forever?

A QGIS example of this is Showing arrowheads in line end using QGIS? (the accepted answer is pinned to the top but has been superseded by the one below it). Workarounds like an accepted answer being edited to point to another or multiple others can be concocted to bypass the voting mechanism but I think such a manual patch should be unnecessary when we have single-click tools to do the job.

You must log in to answer this question.

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