View Single Post
  #81   Report Post  
Posted to uk.d-i-y
Mike Barnes[_2_] Mike Barnes[_2_] is offline
external usenet poster
 
Posts: 966
Default OT - Programming Languages

Tim Watts wrote:
On 29/01/15 22:11, Mike Barnes wrote:

I didn't read that, I just started using PHP. It's important not to get
hung on preconceptions about what a tool should be like, based on tools
you've used before. The author is clearly well up on the theoretical
aspects of language design and implementation, and from that point of
view of course PHP sucks. But it's popular for good reason.


The fact that error handling is completely broken and logging sucks is
not a theoretical problem. It's a very real problem when some broken
arsed PHP stops working on my servers and *I* have to try to debug it.

The random string casting is an abomination too - even perl does that
better, despite having the same design goal of "trying to be helpful".

The error logging aspect has always annoyed me even before I had any
other reasons to be prejudiced as it makes my life hell trying to debug
other peoples code.

It did also strike me when I actually had to write some that the naming
of stuff was totally inconsistent too.

I have not personally been bitten by half the stuff in that article but
it has shown me two things:

1) Never ever use it when there is any choice;

2) Explains to some degree why it's usually some PHP monstrosity that
gets my servers hacked (eg PHPBB, Wordpress). It's a buggy language
which seems to have been designed by woolly headed people and attracts
woolly headed people in droves to write buggy code with their buggy
language.

That does not mean you can, as the author said, write good stuff in PHP
- so don't think I'm levelling insults at the competent who can write
good code and be on guard WRT to the language bugs, but the hours I've
spent dragging hacked servers back to life entitles me to a bit of a rant.


I sympathise, and I'd be the last person to deny anyone a good rant. The
person who wrote the "fractal" critique was obviously enjoying himself
immensely.

While mulling over the topic last night I came to the conclusion that
PHP places a lot more responsibility on the programmer than most
language environments, which is what you seem to be saying to some
extent. As an experienced (started in 1962) coder I find it refreshingly
trusting.

Somewhat paradoxically I think PHP might be a good language for a
beginner because it usually does *something* even if it's not what you
thought you'd told it to do. Its anarchic nature means an absence of
off-putting bureaucracy such as you find in VB. When the beginner gets a
bit more experience he's more likely to be more tolerant of an
environment in which a program refuses to do *anything* unless you've
dotted all the "i"s and crossed all the "t"s.

And people have the check to criticise perl!


No language is above criticism. I like perl but have totally converted
to PHP for new projects, and I translate old perl to PHP from time to
time. For your peace of mind I should add that these are all personal
projects and it's a quarter-century since I wrote anything that I
expected anyone else to maintain (or even look at).

--
Mike Barnes
Cheshire, England