Page MenuHomePhabricator

Rename 'all_links' to 'new_links'
Closed, ResolvedPublic

Description

As shown in this table (created by me), all_links does not fit the old/new naming scheme. It should be new_links instead.

Keep the old name as a (deprecated) alias.

Event Timeline

Change #1137560 had a related patch set uploaded (by Matěj Suchánek; author: Matěj Suchánek):

[mediawiki/extensions/AbuseFilter@master] Rename all_links to new_links

https://gerrit.wikimedia.org/r/1137560

matej_suchanek changed the task status from Open to In Progress.Apr 20 2025, 3:17 PM
matej_suchanek claimed this task.
matej_suchanek triaged this task as Low priority.

However, new_links introduces an ambiguity: it could suggest that the variable contains "new links" only, meaning "added links," whereas it actually refers to "all links of the new revision". The new_html, new_text, and new_size variables are less affected by this potential misunderstanding.

I explored alternative approaches using AI but couldn't find a better solution.

In deciding between all_links and new_links, I ended up with the following, which I lean toward:

Since variable names should be intuitive and reduce cognitive load, avoiding misinterpretation tends to take priority in long‑term usability. If the risk of confusion is high, all_links may be the safer choice, even if inconsistent.

My argument is based on the analogy:

  • old_wikitext (removed_lines), new_wikitext (added_lines)
  • old_links (removed_links), ???_links (added_links)

Change #1137560 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Rename all_links to new_links

https://gerrit.wikimedia.org/r/1137560