Definitions

A software rewrite means throwing out the old code and rewriting it from scratch. This is usually a bad idea, but when done, should be done with the strangler fig pattern so that it is incremental.

A software refactor means taking existing code and slowly changing it so that it is better.

Thoughts

I hear the idea that mw:Extension:PageTriage (the software used by new page patrollers) needs a "complete rewrite" often. I think this is a bad idea. Here's why:

My list of phab tickets to prioritize is located at the PageTriage kanban board. Priority technical debt has its own column. These can be knocked out without rewriting the entire extension.

Discussion welcome on the talk page.

If you're a dev and you see some things that stink about the PageTriage code, please let us know in this Phab ticket about PageTriage's technical debt.

What did we end up doing?

The top part of this essay was written in October 2022. It is now January 2024, and we can now look back on what happened with the benefit of hindsight.

On the back end (PHP), we ended up keeping things mostly the same. Some of the changes include Novem moving some maintenance code from files to classes, Susana adding some integration tests, and Kosta breaking up a big class into smaller classes using the Record/Lookup/Manager pattern.

On the front end (JavaScript), we ended up doing a very heavy refactor. DannyS712 and Jason ended up converting Special:NewPagesFeed from Backbone.js/Underscore.js/JQuery UI to Vue.js. This was a lot of work, but not quite a rewrite from scratch – code was copy/pasted and then modified to work with the new framework. Sohom later converted this to Codex.

Susana is now working on using the strangler fig pattern to incrementally replace each flyout menu in the Page Curation toolbar with Vue.js, one flyout menu at a time. Volunteers may take over this task as we get more comfortable with Vue.js.