Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119326 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87698 invoked from network); 18 Jan 2023 17:52:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jan 2023 17:52:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 431B3180212 for ; Wed, 18 Jan 2023 09:52:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 18 Jan 2023 09:52:05 -0800 (PST) Received: by mail-yb1-f181.google.com with SMTP id 20so20000628ybl.0 for ; Wed, 18 Jan 2023 09:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3KqOeZl+WhIzUL3KQmd/keUJqF7i+/xaF0yfN0Qy9XA=; b=aqvBXOx1kOuROs5SA3TG2C5jPGT6qFKPU5egkO3+skI2NCUY8cNBVJCdSd6H3G4YAJ QzC2im/FmUuO6ruLBooFey6ko3rNxvrdD09nDyb9vquUZ0Bxt/2OGm7XPckN8AMtVvlY 2+5JxJ8c7z5L8ZYkWO7jXEBVfMEN1j04/TTSTK8FQEnNqcM9E2N/xVVjwUAQpLOakB+B CbMTlSgiByh2CbhBtXFZg6QSdD4GhvWCOLVOffyuq01le3UsHL7KtmoBsAXSwav6iAFC iPZou4adWiETdw4F8bcQ4SmhxRZCit2BUfPZk9s4dg4DFG2tvdL0IoHEcydpPSKtcL8L 9e6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3KqOeZl+WhIzUL3KQmd/keUJqF7i+/xaF0yfN0Qy9XA=; b=QJbho0Nx+5Rh88P+cvzyY1CvYmOvbGuHKwjpH2BDenKbMtmoFCXsqSVxSNV4LkittF ppi5f1KpnEBPAtoZlBl7FliN7Nl5n0/byexDH86wNbtd2IJUYOyrhmPKQigjEzMZ9yAB Rq5VMHOe4vzOsQK4Euq++ud7/wEnDPHuqaL3jFxvMA89Il77C0TNMMTVMpKN/Zz9RIeb GOoORV/mgHw0RhLUQ5zVfweESjZmXbb6iTIMr0PZu/KOGhCFdvOgcEbPYnrwZmI7NAIb A7XPFJfLyAItW03iB/NdzneVdVTNDNMfWB8C93vlD47D0l+IsVSoMEpt6PZ1ZK4IkSmP GmsA== X-Gm-Message-State: AFqh2kq6q6Ij1nLyBWH7AJE/5vPTyYDo+Jg6Tr2XL7BFH6eMTswqBhc1 UHQS+F0ko3/zybNTgoi6FO7uY0muq3b2cDLudnLoOWZJI/s= X-Google-Smtp-Source: AMrXdXu7VWX/hvbtqKJG1GCaPU0QOzkVvhKSVp1EFz3Rg0/WINpmXphdMjZb61WHhiNJI6YuDpwhzO5/SK7JkTIeh0U= X-Received: by 2002:a25:ba48:0:b0:797:cc8c:d54f with SMTP id z8-20020a25ba48000000b00797cc8cd54fmr1041757ybj.291.1674064324866; Wed, 18 Jan 2023 09:52:04 -0800 (PST) MIME-Version: 1.0 References: <8DA390C5-5E67-4847-A89F-1A8CCC6C5389@gmail.com> In-Reply-To: <8DA390C5-5E67-4847-A89F-1A8CCC6C5389@gmail.com> Date: Wed, 18 Jan 2023 17:51:53 +0000 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000006a384d05f28d799d" Subject: Re: [PHP-DEV] RFC: rules for #include directives From: tekiela246@gmail.com (Kamil Tekiela) --0000000000006a384d05f28d799d Content-Type: text/plain; charset="UTF-8" I am in both camps. I think some slight cleanup might be in order, but not how you are proposing it. First of all: - I am against forward struct declarations. I think they decrease code readability and should be avoided. - I am against putting comments on #includes. Comments are noise in code and often go out of date. Especially in a situation like this where the comment is physically far away from the code that introduced it. To take the example: > #include "zend_portability.h" // for BEGIN_EXTERN_C What if in future the need for BEGIN_EXTERN_C disappears? Who is going to remember to update the comment? As you said yourself, this refactoring has no practical effect on compilation times. But your RFC states this as one of the advantages. This is misleading. Another advantage listed is "more correct code". Perhaps it is, but does it mean that the current situation is likely to cause more frequent PHP bugs? Would this refactoring help in finding PHP bugs more quicker? Others have raised a valid point that PHP bugs are fixed in earlier versions and then merged up into master. What you are proposing is going to lead to issues with merging. And I don't mean merge conflicts, because includes rarely change in bug fixes. I mean things like a bug fix using a symbol that hasn't been used in the file but is included through one of the more generic headers. Once such a commit is merged into master, it may turn out that the symbol lacks a new include. This adds unnecessary work for bug fixers who will now have to verify this and find the appropriate include during merges. So maybe reduce scope of this refactoring? Do it only where it's strictly necessary. Don't use forward declarations or comments. Or maybe have all ZEND headers included with a single header? Refactoring needs to make developers' life easier and not just be done for the sake of following best-practice. --0000000000006a384d05f28d799d--