Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59957 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3396 invoked from network); 15 Apr 2012 10:58:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2012 10:58:23 -0000 Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:40000] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/B8-47365-EC9AA8F4 for ; Sun, 15 Apr 2012 06:58:22 -0400 Received: by pbcun1 with SMTP id un1so5801693pbc.29 for ; Sun, 15 Apr 2012 03:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=M98lFu0sWeliTdy78FFVnbo7QwStSt24g3Ud8wMfI14=; b=ZZ6Ytsci7FoydNp6JgSVXIBSQkBbUJSHynRhhHnN4Uc6NxiAEfAJtB491no1NnndO7 MgBFW8ZZZWAaQZgql6aSZ//pFm6J5Th79IplgxmB0tbL3COKV0OVdebZ9lFbY2qh/K9T SkCqt2aZ992RcXdMvPni0O3KiNoGFbMONICQYNNHbQTRp3cXNmRd7uvvjWLXSkwvGq90 X86IcHY2b1tJnTz2b5lh4kQXqwE/UQQ1gRbIGDmMSO2H2gIOUNNidfyDF8AzcL91lOou cfk8UbwKZzxAkBzZPsmuamm83fIOgqK0IgAsuTn542eml6yyRo903mnBwWnvW6ix1viC 4y+Q== Received: by 10.68.202.167 with SMTP id kj7mr19640454pbc.9.1334487498762; Sun, 15 Apr 2012 03:58:18 -0700 (PDT) Received: from [192.168.0.5] (dsl-202-173-152-56.vic.westnet.com.au. [202.173.152.56]) by mx.google.com with ESMTPS id y3sm14410592pbh.59.2012.04.15.03.58.16 (version=SSLv3 cipher=OTHER); Sun, 15 Apr 2012 03:58:17 -0700 (PDT) Message-ID: <4F8AA9CF.6000003@gmail.com> Date: Sun, 15 Apr 2012 20:58:23 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Kris Craig CC: John LeSueur , internals@lists.php.net References: <4F876943.8030105@gmail.com> <4F877777.8050806@gmail.com> <4F8782CC.8030205@gmail.com> <4F87C9B0.4080809@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------050106040704060901060607" Subject: Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts From: davidkmuir@gmail.com (David Muir) --------------050106040704060901060607 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 14/04/12 03:41, Kris Craig wrote: > > > On Thu, Apr 12, 2012 at 11:37 PM, David Muir > wrote: > > On 13/04/12 15:13, Kris Craig wrote: > > Again, the controller should NOT be a .phpp file. Likewise, > your model > > should NOT be hooking directly to the view. The controller > hooks to the > > model. The controller then sanitizes that and returns it to the > view. > > Alternatively, if you're not conforming to a pure MVC standard, the > > controller can also hook to a regular .php file in the model and > pass the > > data to that. Either way, it all passes through the controller. > The model > > and view should never be interacting directly. MVC or not, > that's just bad > > architecture and there are zero advantages to using such an ad > hoc approach. > > > > If a developer insists on using such a broken model, however, > they're more > > MVC is a broken model/bad architecture? > > > Arrooo? Not sure where you got /that/ from, as it's basically the > exact opposite of what I said.... > That was me being snarky. I understood what you were trying to say, but you were trumpeting the superiority of MVC, while deriding architecture that conforms to common MVC patterns. > > > than welcome to! That's what people love (and hate) about PHP. > It's > > flexible. They just won't be able to use a .phpp file upstream > from that, > > as it is by its very nature inherently incompatible with such a > broken > > model. The only way to force it to be compatible would be to > make the > > .phpp file essentially meaningless. > > > > So if you're writing good code structure, a .phpp file will help > you make > > it even better. If you're writing bad architecture, then just > keep doing > > what you're already doing and don't worry about using a .phpp > file! This > > will in no way stop you from being able to do what you can > already do in > > PHP. You're just insisting on wanting to use a pure code file for > > something that it's not intended to be used for. Just like > having object > > orientation added in PHP 5 didn't stop you from writing > procedural code if > > you want to, introducing this in PHP 6 won't stop you from writing > > disorganized code if you still want to. What this will do is > provide a > > valuable option for people who do feel that writing clean, > role-segregated > > code is important. > > So basically, the only parts that might be ok to write as .phpp > are some > model and utility classes? > > > Essentially, yes. Despite your implication, often times these > components make up the vast majority of a modern PHP application. It's also the portion that is typically not provided by frameworks and libraries. If you're extending or implementing anything from those libraries, and they're provided as .php (as most things would be), then you won't be able to use them in your .phpp classes (unless you explicitly include them from a .php file further up the chain). You end up losing a lot of flexibility, with no perceivable gain. Cheers, David --------------050106040704060901060607--