24

Reviewing these edits I see no reasons suggested.

I also have an issue with this:

  1. Jul 16 2013 I provided my answer
  2. Nov 6. 2013 Gordon copied the quotation info about PHP 5.3.3 from my answer and inserted it into the highest upvoted answer (omitting attribution, I'd consider this a bit rude if I were a new member)
  3. Today Your Common Sense added info about PHP 8.0 into the highest scoring answer

The issue is that doing this the edited post gets more upvotes giving the author more privileges. This is not a community wiki. What if some new contributor provides some great posts? Useful remarks from his post would be stolen and merged into the highest scoring answer. The effect is that if someone creates a post that reaches autogrowing threshold, he earns priviledges in time without any contribution on the account of someone else's effort. It is much more difficult to earn priviledges today, which makes SO community fossilizing.

These edits change the answer. Wouldn't be providing own answer a better approach? If the new answer is good, it will quickly get upvoted and grow above the old accepted one. Or it doesn't have a chance to do so in the next 10 years? Is the outdated accepted answer fossilized forever?

If the reason for such edits is an attempt to make obsolete content relevant, then it would be fair to edit the new info to ALL the answers, not just the highest scoring one.

I also believe the question edits from hakre miss the point. The question may be interpreted as why PHP introduced the unusual keyword constructor over the common named one or what is the syntactic advantage of this, not which constructor is currently supported.

12
  • 27
    Don't forget some users will be still using older and obsolete systems and still come here to find answers. The site is not just about fixing the latest of anything! Commented Aug 13, 2023 at 13:58
  • 23
    Yet another way that the incentive system is broken. Trying to improve content and keep it current and actually build the library, ends up rewarding an original author who may have barely done anything in years, and giving them curation privileges that aren't in any way tied to demonstrated understanding of curation. Commented Aug 13, 2023 at 18:43
  • so is this question really about obsolete functionality, or about making edits to posts that should be new and improved answers? because it seems to me like the second, where the answer is- don't. write a new and improved answer.
    – starball
    Commented Aug 15, 2023 at 3:55
  • @starball I also thought at first it was the second issue, but the accepted answer only applies to answers with outdated functionality, so I guess not.
    – GOTO 0
    Commented Aug 15, 2023 at 4:12
  • answering about something being outdated and how to do it in the new way should either be an edit by the post owner, or a new answer if the content author is not the post owner of the answer about the outdated functionality.
    – starball
    Commented Aug 15, 2023 at 6:12
  • @KarlKnechtel " the incentive system is broken" I agree that something is broken but is it the incentive system. If you ask me this behavior is rather an expression of people trying to convert SO into Wikipedia because that seems like a better solution to present relevant knowledge on top of a page. Maybe more than just the incentives is broken. Commented Aug 15, 2023 at 7:49
  • 1
    @NoDataDumpNoContribution no; SO is supposed to be like that. Libraries do not contain books that were commissioned by the person checking them out, according to individual taste; they contain books that were written with a broad audience in mind. Commented Aug 15, 2023 at 7:54
  • @KarlKnechtel The editors, who do not get any rep from the upvotes on the edited posts, simply wanted to improve the site and the reason for that being a good or bad idea is that SO isn't Wikipedia, but maybe it should be more like that. Even the original author of the accepted answer couldn't have expected that others will later prop up his post that much, so I'm not convinced incentives play a big role. Commented Aug 15, 2023 at 7:59
  • 1
    The point is simply that answering questions and tailoring them to OP, in the moment, is incentivized directly by the reputation system; editing answers to remove noise, address the audience and keep up-to-date is not. Commented Aug 15, 2023 at 8:05
  • And now the question is getting close votes...
    – TylerH
    Commented Aug 15, 2023 at 13:31
  • @TylerH ...as opinion based, which is not the case as there is an official PHP RFC to remove named constructors (which explicitly states the advantage).
    – Jan Turoň
    Commented Aug 15, 2023 at 19:56
  • @JanTuroň The linked RFC simply says that named constructors will be deprecated, and how. Nothing in there speaks of downsides to renaming classes. The only reasoning provided in there is "[...] the strangeness of when the constructor is and isn't used increases the mental model for programmers." which incidentally isn't really the way the answers are presented. Commented Aug 16, 2023 at 14:26

4 Answers 4

30

As a broad rule, when a question talks about functionality that is no longer available, the answers should be retrospective. This means that they should be written as if they were written when the functionality was still available. It's reasonable to put a small note at the end of an answer mentioning that the functionality is no longer available, but the note shouldn't be the focus of the answer. If there are multiple answers, then instead of putting the note in each answer, one could put a comment on the question with this information.

Do not update answers to rewrite them completely. Don't change the meaning and remember to always answer the question asked.

8
  • 7
    Unless it's a community wiki. Commented Aug 13, 2023 at 15:48
  • 6
    But does the question itself deserve exactly "Moderator note" about its obsoleteness (stackoverflow.com/revisions/217618/8)? I would expect any SME with sufficient rep could edit the question and add such technical details. So, what is the purpose of "moderator" word in that edit? Does it actually help to moderate? In the current form it looks like "Mortals, don't even think about changing that paragraph":)
    – Tsyvarev
    Commented Aug 14, 2023 at 6:55
  • 4
    You post this answer as if this is the rule, but how to handle deprecated/obsolete answers has been a discussion point for over a decade already.
    – CodeCaster
    Commented Aug 14, 2023 at 7:08
  • 1
    @CodeCaster Right, but my answer doesn't talk about outdated answers. I don't consider any of the answers on the linked question as obsolete. The question is asking about a historical feature.
    – Dharman Mod
    Commented Aug 14, 2023 at 9:35
  • 6
    @Dharman the question was asked 14+ years ago when the feature was not historical. I find that the edit that was made, made the answer current and up-to-date, by letting readers know that A) you nowadays only have one option, and B) on earlier versions, this would have been the considerations: (rest of original answer).
    – CodeCaster
    Commented Aug 14, 2023 at 9:40
  • 1
    The only thing I care about is sense and nonsense. Losing information, especially historical information, is nonsense. So as long as we add and do not replace, I'm fine with either updating existing answers or adding new ones. With the new way of sorting answers, there should be less resistance to posting new answers.
    – Gimby
    Commented Aug 15, 2023 at 9:36
  • I'd change the moderator note to be something along the lines of "I am using PHP 5" or a tag with a version and leaving the information that nowadays the feature no longer exists to the answers. The OP didn't know anything about PHP7 or 8 back when they asked the question. As @Gimby says, the new sorting way should be fine to let relevant (i.e. in time) answers float to the top.
    – Adriaan
    Commented Aug 15, 2023 at 13:58
  • @Adriaan The question can be put in other words like this: "Why did PHP designers introduce __construct in PHP 5 and why is this a better replacement than named constructors?". The fact that OP used PHP 5 is obvious, otherwise they would not be asking this question.
    – Dharman Mod
    Commented Aug 15, 2023 at 14:23
11

I've said it before and I can repeat part of my answer here again:

Given:

  1. Outdated Accepted Answers: flagging exercise has begun has (to my knowledge) not had a follow-up, so we can't let the system add a banner like

    "Warning: outdated, see [other answer] for the current [approach]"

  2. How to handle historical, highly upvoted but completely incorrect answers was about answers that were wrong from the start, which this wasn't, it's just become outdated over time,
  3. The new sort order did not become a default and the correct answer won't flow up soon,
  4. It will (figuratively) take ages for the seventh answer (sitting at a score of 4 after 8 years), mentioning the renewed approach, to outrank the accepted answer at a score of 72,
  5. It is a factual change for which you can provide a reference,

I'd say: just edit it.

People claim "don't change the meaning of the answer" as a reason not to update answers with changes over time (as newer versions of standards, languages and libraries emerge).

The question here, quite literally, is:

Is there any advantage to using __construct() instead of the class's name for a constructor in PHP?

I can and should be interpreted as such, because it was about the current version when it was asked (no version-specific tags present):

In the current version of PHP, which approach should I use and why?

By taking this approach to editing, we can update answers without changing their meaning, but instead keeping them up-to-date. See also the Help Center's page Why can people edit my posts? How does editing work?:

Editing is important for keeping posts clear, relevant, and up-to-date

and

Some common reasons to edit a post are: [...] To correct minor mistakes or add updates as the post ages

The answer nowadays, in the 8.0 version of PHP which was released almost 3 years ago already, is:

Since PHP 8.0 you don't have a choice anymore, you must use __construct().

This is important information that must be added to answers about features (named constructors) that are deprecated (PHP 7) or removed (PHP 8) whenever possible.

5

Nov 6. 2013 Gordon copied the quotation info about PHP 5.3.3 from my answer and inserted it into the highest upvoted answer (omitting attribution, I'd consider this a bit rude if I were a new member)

That would need attribution to the PHP manual, not to your answer. As a matter of fact, the attribution was missing from the original answer, where we fail to see attribution or link to the original PHP manual material.

Saying that you "miss attribution" is a bit weird. You didn't write those lines; you quoted them.


The goal is for people to find information that is relevant, while keeping relevant historical information. The advantages of __construct over named constructors are very well explained in the other highly voted answers, and they deserve to stay visible for people learning about it or still using older versions of PHP.

Editing relevant notices in old answers about how technology is not available anymore is the greatest service we can give to people reading about PHP nowadays.

If someone is still stuck, by whatever twisted turn of fate, with PHP 5, they probably will be able to glean relevant information from an answer that tells them not to use it anymore while presenting historical information, but anyone who in fact, does not know that that belongs in the past, really needs to be told about newer versions of PHP.

5
  • 5
    "Editing relevant notices in old answers about how technology is not available anymore is the greatest service we can give to people reading about PHP nowadays." - this. People gotta lose the conservationist attitude here. We aren't writing a history book, we're making a wiki.
    – CodeCaster
    Commented Aug 15, 2023 at 5:38
  • 2
    Exactly @CodeCaster. There are too many people quoting dogma around what new questions are supposed to look like, completely ignoring that said dogma is patently unhelpful for old questions.
    – Ian Kemp
    Commented Aug 16, 2023 at 8:53
  • 1
    @CodeCaster that's just it - it isn't history. We can't pretend old versions aren't in use anymore, or that old code doesn't exist anymore. No matter what I do I always end up having to upgrade ancient stuff to modern stuff - having knowledge of said ancient stuff around is very valuable. The internet is very forgetful, a knowledge base such as Stack Overflow should not.
    – Gimby
    Commented Aug 16, 2023 at 9:14
  • 2
    @Gimby nobody's talking about removing information here. It's about adding a banner to the most visible (most upvoted) post, on top, to notify later readers who are as time progresses more and more likely to not use the version in which the outdated behavior was supported. That's what the majority of users are looking for, and that's what should be accomodated.
    – CodeCaster
    Commented Aug 16, 2023 at 9:19
  • 2
    There's nothing to say a wiki can't contain historical information... in fact that's arguably its purpose!
    – Ian Kemp
    Commented Aug 16, 2023 at 9:19
3

I believe that in this case, the most helpful (not necessarily most correct) approach would be:

  • edit the question's title to include "PHP 5"*
  • create a tag and annotate the question with it
  • move the "moderator note" to the beginning of the question and change it to read something like:

Note: This question is around functionality that was introduced in PHP 5, obsoleted in PHP 7 and replaced by (something - I don't know PHP), and removed from the language in PHP 8.

It would also be useful if the above note could have links to (a) the relevant functionality (b) the deprecation/removal/replacement notices, in each of the language versions.

* I'm aware that putting tags in titles is frowned upon, but we all know that nobody reads tags.

8
  • 4
    This feels terribly counterproductive and unmaintainable. Technology changes all the time.
    – CodeCaster
    Commented Aug 14, 2023 at 12:24
  • 2
    A version tag - like php-5 - would be useful for denote when a feature, described in the question post, appears. But such tag is irrelevant to the "outdating" aspects of the question - I would never assume a version tag to be used for denote that a described feature is now dead. "I'm aware that putting tags in titles is frowned upon" - nothing wrong in the tag added into the title organically, without surrounding square brackets. E.g. "__construct() vs SameAsClassName() for constructor in PHP 5". But again, such title doesn't hint that the the feature is now outdated.
    – Tsyvarev
    Commented Aug 14, 2023 at 13:16
  • "It would also be useful if the above note could have links to (a) the relevant functionality (b) the deprecation/removal/replacement notices, in each of the language versions." - I would prefer, in opposite, that the beginning note would be reduced to 4-5 words, like "This question is about functionality existed in 5-7 versions of PHP". A long introduction, like a long title, greatly distracts from reading a question. A complete history of a feature could be described at the end of the question post, like in the Dharman's edit.
    – Tsyvarev
    Commented Aug 14, 2023 at 13:28
  • 3
    "create a [php-5] tag" I'm surprised to see that we already have [php-5.1], [php-5.2], etc, but no [php-5] tag. I don't know PHP 5 that well (I've only used PHP 7), but it seems like in most cases a single [php-5] tag would probably be more useful than a [php-5.x] tag. Commented Aug 14, 2023 at 13:49
  • This would fit if the question could be rephrased as Should I use keyword constructor in PHP?, but it would change the meaning entirely if the OP meant it as Why PHP introduced keyword constructor?
    – Jan Turoň
    Commented Aug 14, 2023 at 16:36
  • 1
    Tags never go into the title. Either a php-5, like all the python-3.x tags, could be used, or it goes somewhere in the body.
    – Adriaan
    Commented Aug 15, 2023 at 13:55
  • @DonaldDuck PHP5 is really old though. I remember minor version tags being more of a standard thing circa 2012 (in general, not just for PHP). Probably to link bugs to specific minor versions or something.
    – Gimby
    Commented Aug 16, 2023 at 9:11
  • @Adriaan Dogma doesn't help people looking at old questions.
    – Ian Kemp
    Commented Aug 16, 2023 at 9:18

You must log in to answer this question.

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