Req #66855 [Com]: There is no NotImplementedException

From: Date: Tue, 25 Mar 2014 16:23:43 +0000
Subject: Req #66855 [Com]: There is no NotImplementedException
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184887@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66855&edit=1

 ID:                 66855
 Comment by:         levim@php.net
 Reported by:        eldmannen+php at gmail dot com
 Summary:            There is no NotImplementedException
 Status:             Closed
 Type:               Feature/Change Request
 Package:            SPL related
 PHP Version:        Irrelevant
 Assigned To:        levim
 Block user comment: N
 Private report:     N

 New Comment:

https://wiki.php.net/rfc has all the information you should
need (or links to it).


Previous Comments:
------------------------------------------------------------------------
[2014-03-25 16:19:31] eldmannen+php at gmail dot com

How/where do I propose an RFC?

------------------------------------------------------------------------
[2014-03-25 16:16:45] levim@php.net

If you feel this strongly about it then propose an RFC; this isn't a bug in any case so
I'm keeping this bug closed.

------------------------------------------------------------------------
[2014-03-25 16:13:29] eldmannen+php at gmail dot com

Levim, no it is not.

Maybe the person implementing the interface haven't written that method yet.
Not all methods in a interface is widely used, some is rarely used.

Maybe some implementations would be very tricky to write, so until further it throw NotImplemented.

Maybe for some reason it is not feasible to support that method given some circumstances and
limitations.

NotImplemented is sane and it is supported in multiple other languages and for a good reason. Having
to write your own seems silly, as its not project-specific, and hence something that would be much
re-used and benefit everyone.

------------------------------------------------------------------------
[2014-03-25 13:47:34] levim@php.net

Just make your own and throw it. I'm in favor of revamping the SPL structures and exceptions
but even then I wouldn't include NotImplementedException; it's a sign that your interface
or parent class isn't designed properly.

------------------------------------------------------------------------
[2014-03-09 17:09:45] eldmannen+php at gmail dot com

RuntimeException can be pretty much anything. It is very disambigous.

While NotImplementedException is very specific and explicitly conveys that this method is not
implemented.

If you get a RuntimeException you have no idea what is going on or why you're getting it.

If you get a NotImplementedException then you know exactly why you got it.

It is also available in many other languages;
Python - http://docs.python.org/2/library/exceptions.html#exceptions.NotImplementedError
Ruby - http://www.ruby-doc.org/core-1.9.3/NotImplementedError.html
.NET Framework - http://msdn.microsoft.com/en-us/library/system.notimplementedexception%28v=vs.110%29.aspx
Java - http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=66855


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66855&edit=1


Thread (8 messages)

« previous php.bugs (#184887) next »