1

When developers are stuck or need help on a piece of code they usually go to any given search engine and usually end up here. They see an answer that is "green" and has a high number compared to the rest they'd blindly use the code and will look over the fact that some of these answers are actually very outdated.

While this is still true for most cases there are some answers that use outdated but still valid code to resolve the situation.

I'm usually hanging around PHP questions, so let me give you an example:

https://www.google.nl/search?q=php+connect+to+mysql+stack+overflow

Results in:

http://stackoverflow.com/questions/20407699/php-connect-to-mysql-database

Now because a user might look for questions and prefer Stackoverflow's readability and clarity they might want to tag this site to the query.

There is nothing wrong with the question, noor the answer except the fact that using mysql_funcionname() is very much depreciated.

Languages develop over time, new methods become available and old code might not work anymore. I think there should be a method to add a header to the post saying "this answer is valid to the question but is discouraged, see this link (linking to an newer answer or documentation) that shows the correct updated way.

Now I realize this is just 1 example, but I keep finding myself in a scenario where still comment on people not to use it. I'm quite sure this does not apply to PHP alone.

Now this is just an idea, I'm just asking to perhaps get a ball rolling.

5
  • 3
    Don't be shy to edit such posts. The reason why other people can edit your answers is precisely to keep stuff correct and current
    – wim
    Commented Nov 19, 2016 at 0:38
  • @wim But wouldn't that harm the ecosystem of search engines, also changing the fact that the updated code might not work with the question the OP provided?
    – Xorifelse
    Commented Nov 19, 2016 at 0:42
  • You can always post a new answer that says "Note that the function frobble has now been deprecated as of version xyz. The proper function now is fribble, and here is how to use it. Code."
    – Ken White
    Commented Nov 19, 2016 at 3:25
  • @KenWhite I would, but look at this from a beginners perspective. Something that looks green with a lot of votes, attracts attention.
    – Xorifelse
    Commented Nov 19, 2016 at 3:27
  • 1
    I'm looking at it from a site perspective, not a user perspective. This site is an archive of knowledge (both past and present and hopefully future). Sometimes people really are using old technology. You cannot possibly expect to go through every single answer that has ever been posted here and make a determination as to whether or not the information is still current. Technology changes far too fast to make that a viable option. Beginners make mistakes, and they'll learn from them - it's part of the educational process.
    – Ken White
    Commented Nov 19, 2016 at 3:33

0

Browse other questions tagged .