Skip to content

Conversation

@pkulikov
Copy link
Contributor

@pkulikov pkulikov commented May 27, 2019

Supports dotnet/docs#12541

@BillWagner those code examples are added into the new location, not the snippets folder. Is that a proper location?

@BillWagner
Copy link
Member

BillWagner commented May 28, 2019

those code examples are added into the new location, not the snippets folder. Is that a proper location?

Yes. That's perfect.

I really like the visual nature of these samples @pkulikov The visual nature of the sample is very compelling.

One global comment I have: An area of confusion for many C# developers is that delegate removal operates on the delegate object not the method. And related is that removing a delegate that is not part of the multicast delegate does nothing, but isn't an error condition.

For example: something like this:

    Action a = () => Console.Write("a");
    Action b = () => Console.Write("b");
    var printer = a + b + a;
    printer();  // output: aba
    Console.WriteLine();
    Action aPrime = () => Console.Write("a");
    printer = printer - aPrime;
    printer(); // output: aba
    Console.WriteLine();
    printer = printer - a;
    printer(); // output: ab

What do you think?

@pkulikov
Copy link
Contributor Author

@BillWagner that's a great remark, thanks! Definitely it should be covered (both in the sample and the article).

That said, I'll be able to make such an edition in a week. So, there are at least two ways to proceed: (1) to keep those two PRs open for a week, or (2) merge them and I'll submit dedicated PRs with the clarifications in a week. I'm fine with both ways.

@BillWagner
Copy link
Member

@pkulikov

Let's make that update in another PR. On my list this week is getting dotnet/docs#12244 merged, and then making some other TOC updates. Leaving this open for an entire week will mean more merge conflicts. The later changes should be fine without any merge isues.

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These samples are great examples for the operations @pkulikov

I'll :shipit: now, then start a new build on the related PR.

@BillWagner BillWagner merged commit c5217ae into dotnet:master May 28, 2019
@pkulikov pkulikov deleted the add-subtraction-examples branch May 28, 2019 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants