Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50892 invoked from network); 11 Feb 2015 07:30:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 07:30:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.173 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.173 mail-vc0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:62172] helo=mail-vc0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/5A-33902-6150BD45 for ; Wed, 11 Feb 2015 02:30:30 -0500 Received: by mail-vc0-f173.google.com with SMTP id hy4so617573vcb.4 for ; Tue, 10 Feb 2015 23:30:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=cWnvoBSBN4IcJ/3ulUsMR2GLhm6NxOO/Sy7zKYUXUBY=; b=Vz2x8CqcZNrwGOgNbk12yXIzo+S1CSNsXb6vEhLGdvbAn/6XhN9roVjc8cOAMWorYD uub1iFbXX9fh+X9ixMkCXoe0hJnCw4IbKuTSozLes0b6xkp69K8KVa4aqBlrtJnU25H3 WinCRE0uHzgsqYCAMcM8v/OT4KUXBPlzCGDU76a0rI7lZSQjFflFOo4uzaBV/jA5OAgi LERuARO31bPeiagZYnt1aE1C+aDyeKaiNVoUC6XAvEjjNDD96hU65K5lD7fRtXOVjM54 4zD2sO4fI/NZCV9ZlEzAgo02Vkec8aq01HGbeFbDJZTMoIy7pKQ8HZfhOXSHuQ7NuFxL x/yw== X-Gm-Message-State: ALoCoQki8w3cQcTkpOd86fXS68ZxSHy4I84i+6qeYFz1ofHLsBBcKJFcXjOa8XE1Pjyb4A8sysPyBP8sam8Djr5XpsX1jHdg18zYObtd6NuMsS2THEGQIasUrVS3CfBrygRNdpVt4Qz86hP2G1LKAIoDwU2qMdr4/Q== MIME-Version: 1.0 X-Received: by 10.52.162.72 with SMTP id xy8mr8983760vdb.12.1423639827462; Tue, 10 Feb 2015 23:30:27 -0800 (PST) Received: by 10.52.74.73 with HTTP; Tue, 10 Feb 2015 23:30:27 -0800 (PST) In-Reply-To: <54DAFF30.6090004@gmail.com> References: <54D7ED22.3080001@gmail.com> <54D9DE4B.7030509@lsces.co.uk> <54DAFF30.6090004@gmail.com> Date: Wed, 11 Feb 2015 11:30:27 +0400 Message-ID: To: Stanislav Malyshev Cc: Alexander Lisachenko , PHP internals list Content-Type: multipart/alternative; boundary=089e0162832634541d050ecafa66 Subject: Re: [PHP-DEV] Design by Contract From: dmitry@zend.com (Dmitry Stogov) --089e0162832634541d050ecafa66 Content-Type: text/plain; charset=UTF-8 it's possible to achieve the same validation just with assert() spread over the code. It's nothing wrong with this, but this is not DbC. The question, if we need DbC at all, is still open. Thanks. Dmitry. On Wed, Feb 11, 2015 at 10:05 AM, Stanislav Malyshev wrote: > Hi! > > > Hello, internals! > > > > DbC is good thing, but the way you want to do this via language changes > is > > really awful. Why do you want to add more custom features into the > > Agreed here. I still don't see what's wrong with just putting the code > at the beginning of the function and whenever you want to check it. Why > this need to change the language syntax? OK, you don't like assert > because it's limited or performance-costly or whatever. We can fix that. > Why we need weird syntax that places function code in three different > places, reuses existing syntax constructs for things that have nothing > to do with their original use and look like Perl YAPH signature? I > understand implementing fashionable concepts is fun, but must they come > with weird syntax? Why can't we keep it simple? > > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e0162832634541d050ecafa66--