[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal
WordPress Trac
noreply at wordpress.org
Mon Aug 29 08:52:06 UTC 2016
#36335: Next generation: core autoloader proposal
-----------------------------+------------------
Reporter: dnaber-de | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 4.7
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------
Comment (by schlessera):
I feel there are differences in how people perceive "error conditions" and
their use/handling in software development.
The way I see it, there are two general types of error conditions:
1. Error conditions that are due to something in the required context of
your piece of code not being in the state you were expecting. This is
stuff like the DB not being accessible, a query that does not produce
results, etc... These types of error conditions need to be gracefully
handled, as they occur at runtime for otherwise perfectly valid code. A
100% bug-free (yeah, right) plugin can still be hit by a DB connection
issue.
2. Error conditions that are due to code that is logically broken, in
whatever way. This is stuff like a plugin using the wrong function,
omitting required arguments, overriding what is not to be overridden,
etc... These types of errors need to break as soon and as hard as
possible. You don't want to continue "somewhat running correctly" with
broken code, only to have it completely failed a month later on the
production server. The more critical your code base fails with such
errors, the better.
So, under these assumptions, someone overriding a WordPress Core class,
and doing stuff that is not meant to be done, is creating error conditions
of the second type. Ideally, this would reliably throw a hundred error
messages at them. This is currently not the case, either with or without
autoloader. This does not mean however that we should try to "avoid"
throwing errors in such a case.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:115>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list