Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112168 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31698 invoked from network); 3 Nov 2020 19:59:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Nov 2020 19:59:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 544261804B3 for ; Tue, 3 Nov 2020 11:19:59 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Nov 2020 11:19:58 -0800 (PST) Received: by mail-lj1-f169.google.com with SMTP id 23so20259986ljv.7 for ; Tue, 03 Nov 2020 11:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=oAEg5vt3C9R9PTq0WGxCSWGSwzvUEyPcWL2EtIQh3Nc=; b=lyPH0rA77Pj0hhzALJeyuJdLkmVkxvOfFuwqR9BQSvAqhIys4j0g4bWFPy6CYpFOqv +9czUPyAn1NWAW5uBghr4RUR8qYg63WtVLJOFIvc4x0g5EE8wZxGz9regkqfFahFCq8r 7B+mjwq0mM7PMNrXlIvaD5AzZ1Nd8ReTuXN09dE4k5g08MMJZv7bbEE9SXz3pGFfwS5K nyvNTip3C0//3Meykc9qB3nGd/bW6T8us9AmLQfADIw5OREjO2PXMLnTYNC7/PVC+jGO i57Yh3/rLd/5H+izyw2r8By3HoeyhFXXkWyHbDA23XKSQswyRxzo9GknsubpSMmmpw9Z aP+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=oAEg5vt3C9R9PTq0WGxCSWGSwzvUEyPcWL2EtIQh3Nc=; b=LmfU1rYe+xT1svs9rJ/+8sH4rE7jKfPdQOLu92KvrcFRIQJj1rurQ1XM1SBowQ7my6 EaAUZfulvYta2L/+sThe9fRHiTI1pYZGNXmoiUrAHNzBvExrT6uwBfyG8Mnifsx8zIvm HPwK+rKawuQmSNd6HckJOUIWradAV/D+nQRnSf/1xbCU0APGYmel+/DSlDwev5KeVJ+p O+Fm5PbFGFhAsJ9wQK69IIJWyKXTnJQ98X27VQl6ulrbsc+SS4A63uemJ5vkTCIeXnKk LR0wTGBGrab8cvm703Iwv5haoehu81ZQd8YcH0QUnJlPOTcDwOPCr+75XOsHmaqAxU8t 1wQg== X-Gm-Message-State: AOAM532nc328ZAXQP948FKJTSpJJ+aJCBqv5CySrs5Az6DuFIlKTEWMK ByLFMfPuk20KxsZKakksRlyOjNz5vqqj+mAp6hSjJn02HZY= X-Google-Smtp-Source: ABdhPJw+I/QvJ4jYaLK03fl06+j0w/So0fkQXifHzi42tELeZkdZTZlxjj0gnnE7p3dnLbaXUK4E6n4VP6BFcbCgYYY= X-Received: by 2002:a2e:8ed1:: with SMTP id e17mr9825923ljl.114.1604431197170; Tue, 03 Nov 2020 11:19:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 3 Nov 2020 21:19:42 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000092efb905b338bfc5" Subject: Fwd: [PHP-DEV] Nullsafe From: zsidelnik@gmail.com (Eugene Sidelnyk) --00000000000092efb905b338bfc5 Content-Type: text/plain; charset="UTF-8" ---------- Forwarded message --------- From: G. P. B. Date: Tue, Nov 3, 2020 at 9:08 PM Subject: Re: [PHP-DEV] Nullsafe To: Eugene Sidelnyk On Tue, 3 Nov 2020 at 19:05, Eugene Sidelnyk wrote: > Null value by itself was invented to indicate lack of data. > But we can't just use it instead of objects, because of how it works. > We need to create a boilerplate of NullObjects. > Consider the abstract factory example: > https://3v4l.org/9D9LU > > The problem is not with nullsafe operator. It is basically in null > constant. To correctly work with absence of object, NullObjects is required > (one for each abstraction). > > > I don't see why users should return null values more often. > > They should not return null values! But with nullsafe they will be prone > to. > > First of all please bottom post instead of top posting. Secondly, that's just your philosophy and the null safe operator was introduced to accommodate this way of thinking. However, this does not mean it's better or should be the way it works, especially now that the null safe operator has already been implemented, and changed established semantics need a *good* reason. Regards, George P. Banyard --00000000000092efb905b338bfc5--