[aklug] Re: Linux/Drupal/PHP/Latest LJ

From: Josh Rhoades <kaiden11@gmail.com>
Date: Fri Oct 12 2012 - 09:08:03 AKDT

I'll get no points for speaking at all well of the be-lipstick'd pig
that is PHP, but I feel it's worthwhile to mention the following:

 - With nearly all of the shared hosting services that I've used or
recommended to others, PHP tends to be what is available and best
supported among their offerings (Ruby, Python, Perl, everything else
is "tacked on"). When you're looking for cheap and easy, PHP is what's
there. Maybe this reflects poorly on the hosting services I've used or
recommended to others, or poorly on my geek cred for not just hosting
my own services, but at the very least it seems to be web development
and shared web hosting's lowest common denominator. Not an argument
for PHP, exactly, but for why things are written in PHP.

 - PHP's "tagging" syntax ("<?php ... ?>"), while older of school, is
convenient, and mostly unambiguous. It's not well designed, or well
thought out, or that popular among the MVC/HTML Templating crowd these
days. But it's a clean separator between plain HTML and HTML generated
by code I've written. It's tiresome guessing how TemplateToolkit will
Perl-ify a virtual method call, or how far Razor's parsing engine can
tell between what it thinks is C# code and an HTML tag. It's nice to
be able to learn one set of semantics for both backend code and
frontend code. Given this, I like to think of PHP as an HTML
templating language that just got out of hand.

 - PHP's array declaration syntax is silly. But its built-in array
capabilities are nice. My first few steps out of my PHP chrysalis had
me grasping for ordered, associative arrays. Java's built-in data
structures were a rude awakening.

 - As a teenager, my father sat me down in front of PHP, and said "go
nuts." I built a random quote generator that I could show my friends
at school the next day. I learned enough HTML to be dangerous, and
enough PHP to be clever, and from there I could steal ideas from the
rest of the developing web. That I didn't know anything about CGI, or
HTTP, or my Apache configuration for probably the better part of a
decade speaks to the niche PHP fills. It let a fledgling programmer
focus on what he cared about, within a context that one could wrap
their head around. You can certainly learn bad habits from PHP. But
you can also learn from them (years and years later).

Anyhow. I should get back to work. I still hate PHP's pass-by-copy and
iterate-by-copy default semantics. I try to never touch its OO because
it leaves me with a sense of dread and shame. I lament its lack of
being able to use functions as first-class objects (at least up until
very recently). And I will always be terrified by the fact that you
can do symbol table manipulation just by doing $$var rather than $var.

But I'll probably continue to prototype various small-to-medium
projects in PHP when I need quick HTML generation with relatively
little fuss, and I don't have to care about hosting it.

 - Josh

On Thu, Oct 11, 2012 at 10:52 PM, Arthur Corliss
<acorliss@nevaeh-linux.org> wrote:
> On Thu, 11 Oct 2012, Tim Johnson wrote:
>
>> I'll be darned: Do a search on "Just write C!" and you will see a
>> link to boutell.com - I used his libraries 16 or 17 years ago as a
>> takeoff reference for my own. So he is still around and as crabby
>> as ever.
>>
>> "veekun" makes it sound like PHP is to programming languages what
>> windoze is to OS's. Talk about crabby. Sheesh!
>
>
> :-) Indeed. Another blog post has him saying this:
>
> "here;s to the PHP Misfits. The pragmatic ones who would pick up
> anything -- even double-clawed hammers -- to build their own future.
> Often ridiculed and belittled by the hip guys in class who write
> cool code in Ruby or Python, but always the ones who just get shit
> done."
>
> Yeah, well, fuck you. I dont write Python because it's cool, and I'm
> rapidly tiring of having invented motivations used as a reason to
> disregard what I say. I use Python because it balances getting stuff
> done with having that stuff not fall over as soon as I turn my back.
> Programming is a world of tradeoffs; most of PHP's trade immediacy for
> the slightest hint of reliability. Those geeks writing sites in
> Haskell aren't always just doing it because it meets some academic
> (when did learning become bad?) standard of purity; very powerful
> typing often solves very real problems in software engineering. The
> tradeoff there is that very powerful typing also makes some common
> tasks particularly difficult to implement. Some people find this
> tradeoff acceptable; many do not.
>
> :-) Brutally honest, and I can respect that.
>
>
> --Arthur Corliss
> Live Free or Die
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Oct 12 09:08:38 2012

This archive was generated by hypermail 2.1.8 : Fri Oct 12 2012 - 09:08:38 AKDT