Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107494 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52510 invoked from network); 11 Oct 2019 12:42:22 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 11 Oct 2019 12:42:22 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 6AB762D1FC9 for ; Fri, 11 Oct 2019 03:25:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Fri, 11 Oct 2019 03:25:29 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id y127so6668075lfc.0 for ; Fri, 11 Oct 2019 03:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=h6zWnsOblM3OaAUnfVlZVfj2fv8JObj4XN369cSUc34=; b=YGoOqML8WP32sBoOiyjPSV0WEMfm92ApSkK/4Butg1zcblRZd6PeV5JUeV1VMWaYSV qpzRDuy5CrMf10tMHzdCdhlEJe5cRZ9ygac1DIrCBOrhh6zNaVjXu/0eRbevTryawydJ hCvY8GC/fcUMUmxibiY9P1xpYhKtVkK8VE51YBvSe8NIRgIuAfMt6sKuUTJZu7ZU8Dce qdUQEmA0GE44xwaIQMCleSkY1LDiD8UF30I0fAC0JKHOHMQp2lojaI7NJXsiQruPru1O WBMOWblur5e3IKactRzaGfA3mw/kMlMVrD/Xg+oV1fyPGpOF7hTMRi7+HcZRCf9gJfJF /vTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=h6zWnsOblM3OaAUnfVlZVfj2fv8JObj4XN369cSUc34=; b=OYZ8eauTMkY9AZ2mZjHqWuTr9TTXqHdbywFdlCR5pLXKAW1SonWfDT75SDX/MXLP6A DXhRRU4YQPdgupWtJxoFfPQ8N5z+BAwXFcsvsiiBGUVZI2E5P72ZWzCk2JAFX/oQwztK sf7kl9EzqeI1ESUU8rgXfUbKXF/kCJu8Uv/T9HsTFdUdWKvqAaotkoAs7Urc43eHW4oi Ww/KBsQGHoH3hHdKR3DQM6/61X+a3xJP+Vu4HifBaX0PP76eQJwEzKg/WUWXuprHgRqb qrgUHrKrxEJ9WA0pMpRVNip/lyLGDx8F9KY49q2C3QPMjP5a82m3CvpPZqfthWDkdTOQ giCQ== X-Gm-Message-State: APjAAAUcyM6hNLPQ/SU1NzZ9bGb/lciYmgSvsXSSH8vwngBNHqoIQcJv LEqggC47QrStYtlCX2OAAuP3rzoCPOS1mUORQkyxsJvNBsM= X-Google-Smtp-Source: APXvYqw+QlRoeEP+G3mK++kdc1n6B94LjK4lmoqv5tsn9IJIRmW6bCvab9U+W7vj5JFuD7pnJAmWvo2GQE7U+z4Q3Rw= X-Received: by 2002:ac2:4c99:: with SMTP id d25mr9023891lfl.112.1570789528075; Fri, 11 Oct 2019 03:25:28 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 11 Oct 2019 12:25:11 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000d6843a05949fef9a" X-Envelope-From: Subject: Migration tooling and the cumulative cost of purely syntactical deprecations From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d6843a05949fef9a Content-Type: text/plain; charset="UTF-8" Hi internals, One thing that I feel gets lost when discussion is spread over multiple proposals is the following fact: Purely syntactical deprecations, such as the recently discussed case of backticks, but also the already accepted deprecations of the "alternative array access syntax" and the (real) cast, can be performed automatically and with perfect reliability. Given a high-quality migration tool, the cost is running "php-migrate.phar dir/" and importantly (and this is the point I want to make) this cost is constant regardless of how many different things get deprecated. For this kind of tooling, it makes no difference whether it only has to replace the alternative array access syntax, or whether it also needs to replace backticks, some obscure variable interpolation syntax, or whatever else we want it to. As long as the deprecation is purely syntactical, this kind of migration tooling is reliable -- this certainly does not apply to all deprecations! For example, the also recently discussed case of undefined variables is not something that can be reliably migrated in an automated way (at least not while producing idiomatic code). Rather than starting a holy war over every single RFC that contains the word "deprecation", I think we should take a look at our migration story and possibly invest some effort into creating a "blessed" tool for this purpose: One that only performs migrations that are completely safe and should be runnable without fear of breaking code. I do realize that there is already quite a bit of existing tooling, things like Rector, various CS fixers and compatibility scanners, but I don't think that we have anything that just works out of the box to do what is safe and no more. If we provide this kind of tooling, I think that the cost/benefit calculation on deprecation changes: If we have any syntactic deprecations at all, then it basically doesn't matter how many different (syntactical) things get deprecated in one release, the migration cost is always going to be the same. (This is of course a slightly simplified view, but close enough.) Nikita --000000000000d6843a05949fef9a--