The point is that we don't raise an E_ERROR when you pass the wrong type
of parameter to any of the other PHP functions.

A "real" programmer is not a Java (*spit!*) programmer; it is someone
that wants to make their code as robust as possible.

Again, I will use the idea of a SOAP server implementation (or any RPC
server); in order to send the correct response to the client, it needs
to be able to catch any runtime error and act appropriately.  Why is
this an issue?  Why doesn't the programmer write code that doesn't use
type-hints?  Well, maybe they won't, but some other person using the
library might, and then they will wonder a). Why it doesn't work?  b).
What is the point of having a type hint anyway?

Using E_ERROR also prohibits using CLI or embedded PHP in a long-lived
application.  I know that PHP is designed primarily for use in a web
server, but it seems incredibly short sighted to design new features
that make using CLI or embed impossible.

--Wez.

On Fri, 28 Mar 2003, Andi Gutmans wrote:

> At 09:49 PM 3/27/2003 +0000, Wez Furlong wrote:
> >Please lets have exceptions here, otherwise you will render type-hints
> >useless (they are intended primarily for OO programmers anyway).
>
> I wouldn't call them useless. It's the same as a script compiler where you
> would error out if you don't use the same type except that in our case it'd
> be at run-time.
>
>
> >I'm somewhat concerned that we are implementing a lot of the new OO
> >features in a half-hearted fashion; I understand that there is a balance
> >to maintain between easy-accessibility and "enterprise" features.
>
> Yes, it is very important to keep the balance. I wouldn't call throwing an
> exception if the wrong type is passed as enterprise. We are talking about a
> situation which is an error condition in any case. Don't make more of a
> deal out of it then what it really is. I don't think we should force people
> who are using OOP in a subtle way to have to start handling exceptions
> especially as we're keeping all of the rest as E_ERRORS.
>
>
> >I've mentioned several times now that unhandled exceptions look just
> >like E_ERRORS to procedural/non-OO programmers; please can we have the
> >new OO-related features throw exceptions rather than trigger E_ERRORS as
> >it allows "real" programmers to write more robust code.
>
> Again I disagree. What is a "real" programmer? You have decided that in
> real programming wrong types in parameters throw exceptions. This is a very
> shallow way of looking at it. I don't think "real" programmer == Java with
> all due respect.
>
> Andi
>
>
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to