Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91833 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61454 invoked from network); 22 Mar 2016 03:25:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2016 03:25:33 -0000 Authentication-Results: pb1.pair.com header.from=come@opensides.be; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=come@opensides.be; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain opensides.be designates 195.154.20.141 as permitted sender) X-PHP-List-Original-Sender: come@opensides.be X-Host-Fingerprint: 195.154.20.141 smtp.opensides.be Received: from [195.154.20.141] ([195.154.20.141:45628] helo=smtp.opensides.be) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/91-46740-B2BB0F65 for ; Mon, 21 Mar 2016 22:25:32 -0500 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id DFB71104620 for ; Tue, 22 Mar 2016 04:25:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i92_O79pjnP7 for ; Tue, 22 Mar 2016 04:25:28 +0100 (CET) Received: from mcmic-probook.localnet (node-ztm.pool-182-52.dynamic.totbb.net [182.52.181.90]) by smtp.opensides.be (Postfix) with ESMTPSA id D51C2104608 for ; Tue, 22 Mar 2016 04:25:27 +0100 (CET) To: internals@lists.php.net Date: Tue, 22 Mar 2016 04:23:09 +0100 Message-ID: <2070425.mznTmPgxij@mcmic-probook> Organization: OpenSides User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: Re: [PHP-DEV] RFC Proposal: Maybe monad and execution time polymorphic methods From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le lundi 21 mars 2016, 17:04:30 Facundo Martinez Correa a =C3=A9crit : > But then I realized the problem. There > are many times where we need uncertainty. Code is a reflection of rea= lity, > and as such, it must reflect uncertainty. NULL is a good enough way t= o > express nonexistence, albeit a bad one. We have been using it in code= for > years, but it is also used to say many things. Things that cause > uncertainty in the code. I receive a null, does it mean it doesn't ex= ists? > That it will exist? Should I allow it? Is it a good value? I for sure= don't > know. And in my experience, I have used it for many of those cases. A= nd in > many situations that I'm not proud of, all of them at the same time. If your function is supposed to return a User and can=E2=80=99t, maybe = it should throw an Exception. Just wanted to point out it can be a good alternative to returning NULL= for error handling. C=C3=B4me