RE: [PHP-DEV] [VOTE] Allowing use of exceptions in the engine

From: Date: Mon, 09 Dec 2013 16:22:37 +0000
Subject: RE: [PHP-DEV] [VOTE] Allowing use of exceptions in the engine
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-70555@lists.php.net to get a copy of this message
> Right, you can absolutely live a full and healthy life in PHP using entirely > procedural code (things like the dual interfaces for MySQLi ensure that) but I > really really do not see "here is an object, try/catch/finally or > EngineException" as "forcing OO concepts on non-OO people" because it > isn't. The user does not need to worry about propogation rules unless they > start writing their own exceptions and try/catch/finally is not inherently OOP. > Even if it was the average procedural user is just going to see the difference > of "Fatal Error you code is screwed" changing to "Uncaught Engine Exception > your code is screwed" if they don't want to bother catching anything, which > they wouldn't if they didnt want to use try/catch... so the whole thing is a bit > of a non-argument. Our implementation of exceptions is very much OO, borrowed from Java (which in turn borrowed a lot from C++). You need to understand a fair bit and know some extra syntax to exceptions properly, even if you don't write new exception classes. We can agree to disagree though, I don't think we'll change each other's mind :) > I know it is not your main concern, but I really don't want this argument > being used as one against this RFC in general. For me it is an argument. Instead of being able to handle these errors in the same way they handle all other errors, now they have to learn new syntax and concepts. I see no reason to change the status quo, which allows those who want exceptions to easily convert errors to thrown exceptions, into a state where those who don't want to use exceptions are forced to use them. Again, it's entirely fair that we disagree... Zeev

« previous php.internals (#70555) next »