I think it's also pertinent to note that we are finally reaching a state where PHP-CS can be voting, which was only achieved after a lot of hard work to make our codebase consistent.
If we make these changes gradually, we're basically throwing away all of the work that was just done recently.
Regards, -- Tyler Romeo https://parent5446.nyc 0x405D34A7C86B42DF
From: Joaquin Oltra Hernandez jhernandez@wikimedia.org Reply: Wikimedia developers wikitech-l@lists.wikimedia.org Date: February 12, 2016 at 14:31:54 To: Wikimedia developers wikitech-l@lists.wikimedia.org Subject: Re: [Wikitech-l] Mass migration to new syntax - PRO or CON?
PRO from me too.
Doing it gradually is just going to make the codebase inconsistent, and tooling can help point patches to the old style to migrate to the new one.
I'd rather do it quickly than have the inconsistency bleed through months or years.
On Fri, Feb 12, 2016 at 8:28 PM, Alex Monk krenair@gmail.com wrote:
PRO from me, for all the reasons mentioned by legoktm
On 12 February 2016 at 19:26, Legoktm legoktm.wikipedia@gmail.com wrote:
Hi,
On 02/12/2016 07:27 AM, Daniel Kinzler wrote:
Now that we target PHP 5.5, some people are itching to make use of some
new
language features, like the new array syntax, e.g. https://gerrit.wikimedia.org/r/#/c/269745/.
Mass changes like this, or similar changes relating to coding style,
tend to
lead to controversy. I want to make sure we have a discussion about
this
here,
to avoid having the argument over and over on any such patch.
Please give a quick PRO or CON response as a basis for discussion.
In essence, the discussion boils down to two conflicting positions:
PRO: do mass migration to the new syntax, style, or whatever, as soon
as
possible. This way, the codebase is in a consistent form, and that form
is the
one we agreed is the best for readability. Doing changes like this is gratifying, because it's low hanging fruit: it's easy to do, and has
large
visible impact (well ok, visible in the source).
I'll offer an alternative, which is to convert all of them at once using PHPCS and then enforce that all new patches use [] arrays. You then only have one commit which changes everything, not hundreds you have to go through while git blaming or looking in git log.
CON: don't do mass migration to new syntax, only start using new styles
and
features when touching the respective bit of code anyway. The argument
is here
that touching many lines of code, even if it's just for whitespace
changes,
causes merge conflicts when doing backports and when rebasing patches.
E.g. if
we touch half the files in the codebase to change to the new array
syntax, who
is going to manually rebase the couple of hundred patches we have open?
There's no need to do it manually. Just tell people to run the phpcs autofixer before they rebase, and the result should be identical to what's already there. And we can have PHPCS run in the other direction for backports ([] -> array()).
But if we don't do that, people are going to start converting things manually whenever they work on the code, and you'll still end up with hundreds of open patches needing rebase, except it can't be done automatically anymore.
My personal vote is CON. No rebase hell please! Changing to the syntax
doesn't
buy us anything.
Consistency buys us a lot. New developers won't be confused on whether to use [] or array(). It makes entry easier for people coming from other languages where [] is used for lists.
I think you're going to end up in rebase hell regardless, so we should rip off the bandaid quickly and get it over with, and use the automated tools we have to our advantage.
So, if we're voting, I'm PRO.
-- Legoktm
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l