-5

I'm in the process of learning SignalR and Autofac. Both of those libraries have changed a lot over the years and so example code for older versions won't work for newer versions of the library. It's absolutely infuriating and a real waste of time trying to work out whether the code you're looking at in a question or answer is for the version of the library you're using.

It seems like it would be really useful if both questions and answers included the version numbers for the library (or libraries) in question?

(I appreciate the tags handle this in some cases)

6
  • Encouraged? Yes. Forced? No. Oct 26, 2017 at 15:03
  • 3
    If you feel that a given post needs to indicate the version(s) of the product(s) used when it doesn't (because different versions would be relevant to the post, and it's not already clear from context what the version in question is) then feel free to ask in comments, and it can be edited into the post. But for a very large portion of questions those conditions simply aren't met.
    – Servy
    Oct 26, 2017 at 15:06
  • @tomRedox I've felt the pain with SignalR recently as I had to upgrade it from v1 to v2.2. But I don't think it is too difficult to recognize the differences. Sure, there are some gotcha's, but you can't expect everyone to post the version numbers in answers assuming that someone might break a particular method in future versions. Having said that, can you give any example where a method or set of methods have been confusing across versions? Oct 26, 2017 at 15:07
  • @NisargShah I'm thinking of it in the same sort of terms as semver really, where there's the recognition that major version changes do break things. What I find is it's easy (or at least easier) to spot the differences if you know a version of the library already, but if you're just starting out in it then you can really trip up trying to make a solution for one version work for another.
    – tomRedox
    Oct 26, 2017 at 15:13
  • re "but you can't expect everyone to post the version numbers in answers assuming that someone might break a particular method in future" - I know what you mean, but if it makes the answers on SO a more useful resource over time wouldn't there be some sense in it? I wouldn't want unversioned library or API documentation for example, so it seems like it would be useful.
    – tomRedox
    Oct 26, 2017 at 15:16
  • Closely related: Mark questions or answers as out of date
    – jscs
    Oct 26, 2017 at 18:05

1 Answer 1

8

The nature of software is for it to evolve and change. This is inescapable and inevitable. However, this doesn't mean that an answer for one older version of the software or library is any less valid than an answer for a newer version.

As a reader, the burden is on you to ensure that the answer you get appropriately applies. We as answerers have no reliable way to tell if the advice given to you today will be broken tomorrow, and because you're going to be reading it tomorrow, you should be prepared to take all advice given to you with a grain of salt, and not as "the" authoritative and indisputable correct approach.

If the answer you read doesn't really apply well to you, you have ways to ameliorate this:

  • Ask a new question, referencing your specific versions and specific concerns, linking back to the older question and explaining why it doesn't suit your needs; or
  • If you've figured it out, provide an answer referencing the newer version of the library.
6
  • I take your point, but as I said in a comment above, I wouldn't want to use, and nor would I write, unversioned library or API documentation. I guess the point is whether SO is intended to be just a collection of answers, or more an encyclopedia of definitive answers that evolves over time. There are some really great questions where people add additional answers that say "as of version x this is the case" and those answers always seem so helpful as they help the reader to the correct answer for the code they are working on.
    – tomRedox
    Oct 26, 2017 at 15:29
  • @tomRedox: An answer for a website written to work around IE6 quirks is still a correct answer. It doesn't mean that anyone can really get any usage out of it since it's based around IE6, but that doesn't invalidate the answer in any way, shape or form.
    – Makoto
    Oct 26, 2017 at 15:47
  • I completely agree, but I just mean that it seems like the answer is of more use (and more efficient to use for later readers) if the reader knows it relates to IE6 (e.g. an answer to the question "does IE support HTML 5" would be a lot more useful if the question states IE6, or failing that if the answer states it refers to IE6 when replying "no".
    – tomRedox
    Oct 26, 2017 at 15:54
  • @tomRedox it is really hard to add information like "this question applies to current version 1.2.3 and will be valid till 2.3.4 shipping in 3 years which will replace this API with much better one, but again applies to 2.4-2.7 where they will introduce bug in that API". :) Oct 26, 2017 at 16:00
  • That's really the job of the reader. We can't hand-hold everyone who reads an answer and assumes that it'll work for everything all the time even today.
    – Makoto
    Oct 26, 2017 at 16:01
  • I don't think anyone's suggesting that @AlexeiLevenkov. What I'm saying is that if you read an answer that says "in SignalR 2.3 you can do this as follows" then if you are using SignalR 4.5 you would know to proceed with caution. Dates give a lot away, but there are long periods of overlap between library versions.
    – tomRedox
    Oct 26, 2017 at 16:03

You must log in to answer this question.

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