:: Re: [DNG] Why MVC: was Why C/C++ ?
Top Page
Delete this message
Reply to this message
Author: Peter Duffy
Date:  
To: dng
Subject: Re: [DNG] Why MVC: was Why C/C++ ?
About 10 years ago, I took on the task of redeveloping a web site, and
had to get up to speed on PHP very quickly. After a few months of
creating working, but horrible and absolutely unsupportable mixtures of
HTML and PHP, I started looking into MVC, mainly out of a need to
preserve what was left of my sanity. After looking at Laravel and
several other MVC frameworks, and rejecting them all for various
reasons (mainly that for what I was attempting, they were all
overkill), I found a package called the "simple MVC framework" by David
Carr:

https://dcblog.dev/launched-a-new-php-framework-simple-mvc-famework

It gave me exactly what I wanted: the whole thing was structured and
written in PHP which was simple enough that even I could understand it
completely, and over the next few months, I made massive strides
forward. However, soon after that, the package became unsupported (Carr
himself has moved onto using Laravel). Eventually, I decided to switch
to CodeIgniter, which seemed to be the closest to what I'd been doing. 

Re. MVC - it's definitely not perfect, or even close: I've lost count
of the number of times that I've had arguments with myself over whether
a bit of code should be in a controller, a model or a view (let alone a
helper or a library). But if the alternative is unstructured HTML and
PHP, MVC is definitely a better option.


On Sun, 2024-08-18 at 17:56 +0900, Olaf Meeuwissen via Dng wrote:
> Hi,
>
> Hendrik Boom <hendrik@???> writes:
>
> > On Thu, Aug 15, 2024 at 03:37:18PM -0400, Steve Litt wrote:
> > > Andrzej Peszynski said on Wed, 14 Aug 2024 23:54:54 +0200
> > >
> > > > 3. Web/DB applications, simplified abstractions, MVC - PHP and
> > > > JS
> > > > family.
> > >
> > > Am I the only one who things MVC is absolute bullshit, where
> > > everyone
> > > has different definitions of it and everyone cheats on the
> > > definition?
> >
> > Separating the model from the VC makes sense.
> > Separating the viesfromthe controller makes no sense.
>
> While I agree that view and controller are typically highly coupled,
> it
> does make sense to separate them as much as possible.
>
> An application may need to represent information in a number of
> formats,
> e.g. PDF, HTML, JSON, YAML and text/plain.  You probably want to
> separate out the nitty gritty formatting in a different
> implementatioin
> for each with a common base View.  That way, the common base is the
> only
> thing that couples tightly with the Controller.
>
> Hope this helps,