not yet / should be implemented

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

not yet / should be implemented

Peter Uhnak
What is the difference?

—————————————————————————————————————
ShouldBeImplemented

I am ShouldBeImplemented, an exception signaled when some method should have been implemented but was not.

This is more like a placeholder during development.
—————————————————————————————————————
NotYetImplemented

I am NotYetImplement, an exception signaled when a method is a stub for code that will be implemented in the future.

This is used in incremental development, for example when doing Test First development.
It is similar to ShouldBeImplemented, with a slightly different meaning.
—————————————————————————————————————

There seem to be some slight semantic difference but I'm failing to see it.
I can even say "The method should be implemented, but is not yet implemented." It's saying the same thing with different words.


Thanks,
Peter
Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

Thierry Goubier
Le 28/09/2015 21:09, Peter Uhnák a écrit :
> What is the difference?
>
> —————————————————————————————————————
> *ShouldBeImplemented*
> *
> *
> I am ShouldBeImplemented, an exception signaled when some method should
> have been implemented but was not.

Usually in a abstract class to signal that a concrete subclass should
have implemented that method... defines the API all subclasses must
answer to.

> This is more like a placeholder during development.
> —————————————————————————————————————
> *NotYetImplemented*
>
> I am NotYetImplement, an exception signaled when a method is a stub for
> code that will be implemented in the future.

Pre-defines an API with a TODO: Implement Later.

> This is used in incremental development, for example when doing Test
> First development.
> It is similar to ShouldBeImplemented, with a slightly different meaning.
> —————————————————————————————————————
>
> There seem to be some slight semantic difference but I'm failing to see it.
> I can even say "The method should be implemented, but is not yet
> implemented." It's saying the same thing with different words.

Hum, should be and not yet have different semantics.

Thierry

>
> Thanks,
> Peter


Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

Peter Uhnak
On Mon, Sep 28, 2015 at 9:36 PM, Thierry Goubier <[hidden email]> wrote:
Le 28/09/2015 21:09, Peter Uhnák a écrit :
What is the difference?

—————————————————————————————————————
*ShouldBeImplemented*
*
*
I am ShouldBeImplemented, an exception signaled when some method should
have been implemented but was not.

Usually in a abstract class to signal that a concrete subclass should have implemented that method... defines the API all subclasses must answer to.

Well the abstract class uses SubclassResponsibility;
SBI is autogenerated by debugger and Class Refactoring > Realize.
 
Hum, should be and not yet have different semantics.

Oh, so it's actually ShouldHaveBeenImplemented (past tense --- as in: "it was supposed to be already done").

so

ShouldBeImplemented - this was supposed to be already implemented
NotYetImplemented - this will be implemented in very soon

Okay, now understand it.

Thanks :)

Peter
Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

Peter Uhnak
Oh, so it's actually ShouldHaveBeenImplemented (past tense --- as in: "it was supposed to be already done").

quoting from the comment

"exception signaled when some method should have been implemented but was not"

So I guess I'm blind because I read it several times but the brain didn't see it.
Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

Thierry Goubier
In reply to this post by Peter Uhnak
Le 28/09/2015 21:53, Peter Uhnák a écrit :

> On Mon, Sep 28, 2015 at 9:36 PM, Thierry Goubier
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Le 28/09/2015 21:09, Peter Uhnák a écrit :
>
>         What is the difference?
>
>         —————————————————————————————————————
>         *ShouldBeImplemented*
>         *
>         *
>         I am ShouldBeImplemented, an exception signaled when some method
>         should
>         have been implemented but was not.
>
>
>     Usually in a abstract class to signal that a concrete subclass
>     should have implemented that method... defines the API all
>     subclasses must answer to.
>
>
> Well the abstract class uses SubclassResponsibility;
> SBI is autogenerated by debugger and Class Refactoring > Realize.

Yes, you're right. I tend to mix the two :(

>     Hum, should be and not yet have different semantics.
>
>
> Oh, so it's actually ShouldHaveBeenImplemented (past tense --- as in:
> "it was supposed to be already done").
>
> so
>
> ShouldBeImplemented - this was supposed to be already implemented
> NotYetImplemented - this will be implemented in very soon

Would be interesting to see that in code, to have a feel about how to
use it.

Thierry

> Okay, now understand it.
>
> Thanks :)
>
> Peter


Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

stepharo
In reply to this post by Peter Uhnak
To me NotYetImplemented is not needed => should be implemented is enough

Le 28/9/15 21:09, Peter Uhnák a écrit :
What is the difference?

—————————————————————————————————————
ShouldBeImplemented

I am ShouldBeImplemented, an exception signaled when some method should have been implemented but was not.

This is more like a placeholder during development.
—————————————————————————————————————
NotYetImplemented

I am NotYetImplement, an exception signaled when a method is a stub for code that will be implemented in the future.

This is used in incremental development, for example when doing Test First development.
It is similar to ShouldBeImplemented, with a slightly different meaning.
—————————————————————————————————————

There seem to be some slight semantic difference but I'm failing to see it.
I can even say "The method should be implemented, but is not yet implemented." It's saying the same thing with different words.


Thanks,
Peter

Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

Carlo-2
Hi

This is one of those things where everyone has their personal opinions and probably not much payoff but anyway here are my thoughts.
  • ShouldBeImplemented - this was supposed to be already implemented
    • This is a stronger form of communication where some abstract behaviour should have been implemented. If this is received in code then this should be considered an error as a base class expects derived classes to have the behaviour or the class will not work as expected.
  • NotYetImplemented - this will be implemented in very soon
    • This is a weaker form of some missing behaviour. This is used to communicate that some behaviour has not been implemented yet, and it would be nice if it was but the rest of the object is still functional. If you'd like the behaviour either harass the owner or write it yourself. Sometime this usage is abused and developers create objects that are not polymorphic and typically break Liskov's Substitution Principle for example.
So I would suggest keep the 2 as they communicate different ideas.

Cheers
Carlo

On 29 Sep 2015, at 9:44 AM, stepharo <[hidden email]> wrote:

To me NotYetImplemented is not needed => should be implemented is enough

Le 28/9/15 21:09, Peter Uhnák a écrit :
What is the difference?

—————————————————————————————————————
ShouldBeImplemented

I am ShouldBeImplemented, an exception signaled when some method should have been implemented but was not.

This is more like a placeholder during development.
—————————————————————————————————————
NotYetImplemented

I am NotYetImplement, an exception signaled when a method is a stub for code that will be implemented in the future.

This is used in incremental development, for example when doing Test First development.
It is similar to ShouldBeImplemented, with a slightly different meaning.
—————————————————————————————————————

There seem to be some slight semantic difference but I'm failing to see it.
I can even say "The method should be implemented, but is not yet implemented." It's saying the same thing with different words.


Thanks,
Peter


Reply | Threaded
Open this post in threaded view
|

Re: not yet / should be implemented

Stephan Eggermont-3
On 29-09-15 12:03, Carlo wrote:
> This is one of those things where everyone has their personal opinions and probably not much payoff but anyway here are my thoughts.
> ShouldBeImplemented - this was supposed to be already implemented
> This is a stronger form of communication where some abstract behaviour should have been implemented. If this is received in code then this should be considered an error as a base class expects derived classes to have the behaviour or the class will not work as expected.
> NotYetImplemented - this will be implemented in very soon
> This is a weaker form of some missing behaviour. This is used to communicate that some behaviour has not been implemented yet, and it would be nice if it was but the rest of the object is still functional. If you'd like the behaviour either harass the owner or write it yourself. Sometime this usage is abused and developers create objects that are not polymorphic and typically break Liskov's Substitution Principle for example.
> So I would suggest keep the 2 as they communicate different ideas.

 From a lean/agile perspective, NotYetImplemented is inventory that we
try to eliminate from the system. There are lots of places in Pharo
where we support doing 'the right thing' by steering with our tools. The
most well known is of course the browser that makes it annoying to use
long methods. I'd prefer NotYetImplemented to be removed.

Stephan