Arvids,

I can only speak for myself of course, but you should never feel as though
you're not welcome to express yourself here freely and openly.
 Frustration, anger, bickering, etc; so long as it's not ad spam or just
completely off-topic, I personally think it's all fair game.  Of course, I
disagree with a number of your points and I'll get to that, but I just
first wanted to put that out there.  Like you, I've monitored the list
(including Internals) for years but only recently started posting to it
myself.  And, like you, I would shudder at the thought of being censored or
"kicked-out" for speaking my mind.  So as much as I disagree with you, I
hope you won't hesitate to speak your mind without reservation!  If anyone
tries to tell you that you can't, I'll have your back (for whatever that's
worth lol).

Ok, now that that's out of the way....  I think you're operating under some
fundamental misconceptions about this debate.  Specifically, there are two
in particular that I feel compelled to address (quoted text is
paraphrasing):

1. "The people advocating strict type hinting are people who either
abandoned PHP long ago or came to PHP from other languages.  Those of us
who are the pure, loyal PHP developers don't support this at all."

I first dabbled in PHP about 12 years ago, back when .php3 files were still
the norm.  About 10 years ago (PHP 4) was when I really started doing
everything in PHP.  I've been using it ever since and it continues to be my
favorite language, in no small part because of its inherent flexibility.

That said, I also have experience in a number of other languages; this
listserv shouldn't be used as my personal resume so I'll spare you the
details lol.  Sufficeth to say, I'd like to think I have a rather
well-rounded background.  But the overwhelming majority of the work I've
done has always been in PHP (at least since 2000) and I don't see that
changing anytime soon.

I also know and have worked with many people who, like me, are die-hard PHP
fans but also believe, like me, that there's still a lot of room for
improvement.  We can live in denial and deride everyone who criticizes our
favorite code as crazy or stupid, but we're only hurting ourselves if we do
that.

So no, this isn't an "us vs. them" situation.  We're all in this together.
 We all have unique backgrounds, each of which enriches the whole by
offering a different perspective.  I don't believe that's a bad thing.
 I've criticized veteran programmers for looking down their noses at
hard-core PHP developers on numerous occasions (and I'm often in the
minority for doing so).  But while their attitudes and conclusions may be
wrong, they do reference some valid points.  Likewise, you've seen me in
this very thread criticizing a PHP developer for looking down his nose at
people with different perspectives.  Some rivalry can be healthy, but I
think there's a lot of unhealthy derision on both sides that just makes it
more difficult for us to have these important conversations.

I'm a veteran PHP developer and proud of it, just as you are.  And the more
I think about it and hear all the arguments, the more I'm convinced that
the introduction of optional strict typing into PHP 6 is the right way to
go.


2. "Strict type hinting would eliminate PHP's flexibility and take away its
unique simplicity."

I respectfully disagree.  Again, let me remind you that we are *not* talking
about *converting *PHP to strict type hinting.  Instead, we're merely
talking about allowing PHP developers to *choose* whether or not to make a
given function use dynamic or strict type hinting.  The default behavior
will remain dynamic, just as it is now.  But there are situations where
strict type hinting, even in a PHP script, would make more sense.  There
are many PHP developers, myself among them, who see considerable benefit in
being able to make a function more condensed and streamlined without having
to waste so much time on sanity checks that could instead be handled at a
lower level in the core.

This would not make PHP any less simple.  On the contrary, we would be
making it *more* accessible to people who come from different backgrounds.
 Under the right circumstances, strict type hinting would actually make PHP
more simple, not less.  This would not be an abandonment of KISS.  I would
never have even considered supporting it if it was.


This idea produces a lot of anxiety among some veteran PHP developers.
 That's understandable.  After all, if you've generally avoided dealing
with languages that use strict typing, the thought of PHP supporting it
could seem very intimidating.  But remember, this is something that would
be an option, at the discretion of the developer (i.e. you).  You would be
the one choosing whether or not to use it in any of your functions, just as
you are the one who chooses whether to structure your code using OO classes
or stick to traditional procedural code.  OO concepts can also be very
intimidating to someone who's accustomed to procedural languages.  But PHP
decided to bridge that gap, and we all survived.  Just as it will survive
by one again bridging an accessibility gap.

There are other important things to work on, but we've always been able to
walk and chew gum at the same time before.  PHP 6 won't be happening
anytime soon anyway, so I think it might be good if we all just took a deep
breath and relax for a moment.  Now is a good time to be having this
conversation.  I don't think we should punt it any further and I will try
to push back against that reflex at least a little bit.  But either way,
this issue isn't going to go away; the fact that it still hasn't gone away
I think proves that well enough.

I don't think anybody is crazy as far as this debate goes.  Both sides have
valid points that need to be addressed with thought and care.  But
dismissing it out of hand or simply ignoring it hasn't worked because
people are still asking for it, so I will be pushing back against that this
time and advocate for a continued, ongoing dialogue on this until a true
consensus can finally be reached.  Avoiding it isn't the answer IMHO.

--Kris


On Sat, Feb 25, 2012 at 8:11 PM, Arvids Godjuks <arvids.godj...@gmail.com>wrote:

> Kris Craig
>
> I usually just read the list, sometimes add if I have something to say and
> I had voiced my opinion on typehinting before. And you know, just from the
> stand of a userland developer who has 7-8 years of experience and devoting
> myself to the excelence at PHP, i see this discussion about adding strict
> typehinting to PHP as ridicilous. I cannot express my thrustration, because
> i would probably be kicked out of the list permanently.
> The problem is that those, who are actually advocating for this, come from
> all sorts of languages (or have moved to them some time ago) and now what
> to "make php better". Sorry folks, but I have picked up a script language
> not because it has strict type hinting, but actually because it does not
> have it. And because in web we are working with text. Almost any data we
> get is text and in critical places we just check that data we have is
> actually a number and not a random string. Or is an object of certain type.
> Or is an array. Or a valid string. And we let the PHP to handle routine
> conversions. And it's good because there can be tons of them per single
> script call. String to number and vice-verse conversions are all over the
> place in almost any script. They are so common, that if you would add
> strict typehinting - you would probably need a type conversion on every
> function/method call.
>
> PHP had (and i have to believe it still has, but people started to really
> forget it) a principle called KISS. And strict typehinting is NOT simple.
> It really complicates things, a lot. And really, in a scripting language?!
> Are people going nuts because of 2012? Has to be, because i just can't
> explain what is happening with the typehinting rfc discussions for the last
> year.
> The way i see it, there is two types of people. The PHP crowd, that says
> that optional weak type hinting could be helpfull and strict-type hinting
> crowd witch has come to PHP from different languages or had moved from PHP
> to them, but ocasionaly returns to it.
>
> What i thing is that core devs should really look at what the php is, on
> what principles it is built and based. Remember what it was built for and
> why it's popular. And that if you handle it correctly - it's a powerful
> tool, and works great. And that we do not need other python, perl or ruby.
> PHP always had it's own way and it should. My vote is for optional weak
> typehinting that will do what the most want - to write a more solid library
> code with less annoing checks and does not put additional restraints on the
> userland code. Because if you give people something like strict typing - it
> just will get abused to such extreme by some people, that it will create
> more negative than good in the long run.
>
> PHP is not the easiest language out there. Yes, it's easy to start with,
> but it's not that easy to master and strike the right balance between
> simplicity and complexity. And people tend to go overcomplex forgetting the
> KISS. I'd rather see the PDO getting a major kick, or dumped allready and
> work gone into db drivers and unicode support improvement - these are far
> more important than strict type hinting.
>

Reply via email to