From: Richard on
On Jun 16, 2:45 am, Michael Wojcik <mwoj...(a)newsguy.com> wrote:
> docdw...(a)panix.com wrote:
> > In article <huu9lq0...(a)news2.newsguy.com>,
> > Michael Wojcik  <mwoj...(a)newsguy.com> wrote:
>
> >> Few people seem
> >> to want to make the effort to write decently structured, maintainable,
> >> robust code when they work in PHP.
>
> > Oh, I *cannot* resist...
>
> > ... and this makes PHP differ from just about any other language... how?
>
> There are languages which enforce more structure, or at least strongly
> encourage it. There are languages which try to avoid having a dozen
> slightly different ways to accomplish any given task. There are
> languages which try for some consistency and discernible design in the
> language itself.
>
> In other words, there are languages where writing decently structured,
> maintainable, robust code is less effort than it is in PHP, and where
> learning the language entails learning some principles for writing
> such code.
>
> PHP is a classic example of an undesigned language; the developers
> just toss in features as they think of them. It's even worse in this
> respect than Perl, and Larry Wall (the creator of Perl) has famously
> said that he doesn't design languages but just tosses in things as he
> thinks of them.

From the Wiki: "PHP originally stood for personal home page."

In the mid 90s PHP was really simplistic. It has grown enormously but
is not 'grown-up'.

Scripting languages tend to be 'code in page' or 'page in code'. The
first is how PHP is normally used with <?php code > tags in the html
page. The second is like PERL using print "<html>..." or even using
functions that create the html page.

I dislike both of those. The page content should be completely
separate from the logic, which is why I use templating.

From: Michael Wojcik on
Howard Brazee wrote:
> On Tue, 15 Jun 2010 10:45:19 -0400, Michael Wojcik
> <mwojcik(a)newsguy.com> wrote:
>
>>>> Few people seem
>>>> to want to make the effort to write decently structured, maintainable,
>>>> robust code when they work in PHP.
>>> Oh, I *cannot* resist...
>>>
>>> ... and this makes PHP differ from just about any other language... how?
>> There are languages which enforce more structure, or at least strongly
>> encourage it. There are languages which try to avoid having a dozen
>> slightly different ways to accomplish any given task. There are
>> languages which try for some consistency and discernible design in the
>> language itself.
>
> So you are saying that there are languages that require less effort.
> Does that mean that people make the effort in those languages?

Some do.

Each worker is willing to expend a certain effort on a project. That
effort varies from worker to worker and project to project, and is
influenced by myriad factors. But when the tools used for a project
require more effort to be used properly and produce quality results,
it's less likely that workers will have that effort available out of
what they've decided to expend.

And it's not solely a matter of effort. What I wrote above cannot be
glossed as "require less effort" without losing important aspects of
the difference between well-designed and poorly-designed languages.
Programs, like other complex authored products, are not created in a
vacuum. Someone writing a non-trivial piece of software is exposed to
other examples of the development language: documentation, code
samples, hopefully other experience with programs written in the
language. A culture develops around each programming language, and
poorly-designed languages tend to have cultures that reflect that poor
design. Certainly PHP does.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University