On Thu, 2003-03-27 at 19:07, Andi Gutmans wrote:
> >How about being able to handle errors in a clean and elegant way?
> >Exceptions make this very convenient.
> We have an error handler.

Context-local error handling is much more convenient (not to mention the
elegance of being able to handle errors in "userspace").

> >Of course, it should not be done in a way to break backward
> >compatibility if at all possible.
> I consider having half of PHP throw errors and the other half as throwing 
> exceptions to break BC.

Even though we are talking about functionalites (type hints) that was
not even available in previous versions of PHP?

> >This is a very bad idea.  One of the points of exceptions is being able
> >to have a standardized way of handling errors.  I also like the way Java
> >does it: if you don't catch the exceptions your code could throw, your
> >code won't even compile.  Now, I am pretty certain that you would not be
> >happy if I said this would be neat to have in PHP.  :-)  Still, I think
> >it would be great to have it as a configuration directive, because it
> >really is a Good Thing to force programmers to handle errors properly...
> If you are looking for a strictly typed language I'd suggest Java :)

I have used Java to a certain degree (and I think this might be showing
in my way of thinking).  I don't use Java any more; I have moved over to
PHP, both for developing web applications and smaller scripts.  What I
*really* would like to be able to do is to develop larger applications
in PHP.  For this, being able to standardize and even "force" (like in
Java) the code to handle errors is actually a very, very useful
feature.  We've all used badly written programs with few or little error
handling...

> We (as in almost everyone) agree that configuration directives should not 
> be added because we want all scripts to run on all PHP enabled servers.

Point taken.  But not everyone is using PHP only on the web.

> >It is true that many people still write imperative (function-based)
> >code.  But that is no argument for not making PHP a really, really good
> >Java-killer.  And, standardized exceptions is really one of the things I
> >find absoutely best in Java.  
> We are not in the business of killing Java. We are in the business of being 
> the best web programming language.

Like Java.  ;-)

Seriously: the Java people are working hard to make Java be the best web
programming language.  Not *only* a web programming language, of course,
but JSP, servlets and EJB (Enterprise Java Beans, persistent objects)
are striving to provide an excellent web platform.

The only big problem is that it is sooooo much slower than PHP...  and
this is one of the main reasons why I have abandoned Java and JSP for
web development.

> One is a strictly typed compiled language and the other (PHP) a dynamically 
> typed scripting language. The reason for PHP's wide adoption is its ease of 
> use, especially vs. strongly typed languages such as Java. I want to keep 
> this advantage.

I understand that, and I don't want to make PHP harder to use.  I hope
this is not the impression I am giving.  I just want it to be easy to
use for power users *as well* as new users, and friendly when writing
big, enterprise-class applications, applications that benefit greatly
from standardized error handling.

> >Many of the OOP problems of PHP4 have already been fixed
> >in PHP5.  Yet, there is still some room for improvement.
> You might call it improvement and some might call it bloat.

Yes, possibly.  The thing is, I consider OOP to be so much more than
"syntactic sugar".  It is a really helpful paradigm for helping avoiding
many of the common programming mistakes.

> Yes, the important problems with the OOP models have been fixed. 
> I don't think we should "improve" PHP until it becomes Java.

:-)

> If that's what you want then java is a URL away.

Thank you, but I have already been down that road and I prefer this one.

> >Just my $0.02.  ;-)
> That was more like $10.00 :)

Yeah, that's why I wrote a smiley.  :-)

-- 
Wishing you all the best,

Per Lundberg / Capio ApS
Phone: +46-18-4186040
Fax: +46-18-4186049
Web: http://www.capio.com

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to