Skip to content

Conversation

@sharpist
Copy link
Contributor

line 81-93: fixed code syntax
line 138-148: fixed code syntax
line 167-177: fixed code syntax

line 81-93: fixed code syntax
line 138-148: fixed code syntax
line 167-177: fixed code syntax
@BillWagner BillWagner requested a review from Thraka November 15, 2018 15:27
@richlander
Copy link
Member

richlander commented Nov 24, 2018

@AaronRobinsonMSFT and I are going to review this PR and document together in the new week. I read most of the doc and found multiple things that could be improved. Please ping me if you want to be part of this.

This is also a good time to decide what we're going to do w/rt COM Interop docs for the upcoming .NET Core 3.0 release, which will support this feature/scenario.

@sharpist
Copy link
Contributor Author

Hello, @richlander and @AaronRobinsonMSFT !
Yes, I want to be part of this. Any of my notes that are useful can be supplemented or corrected and used.
COM Interop documentation may be improved with time including new features in .NET Core 3.0.
Thanks!

// Implicitly extends System.Object.
public class Mammal
{
public Mammal() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

If a class doesn't define any other constructor, it will have a default public parameterless constructor. So I don't think adding the constructor here and also below is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, this default public parameterless constructor has been added only as a visual example for perception. It can be deleted.

{
public LoanApp() {}

Int32 IExplicit.M() { return 0; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's more idiomatic to use int, rather than Int32. Also, you could use expression-bodied method here:

Suggested change
Int32 IExplicit.M() { return 0; }
int IExplicit.M() => 0;

The same applies for the block below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I would choose a classic implementation. Because the 'return' instruction is more recognizable and identifiable.

Copy link
Member

Choose a reason for hiding this comment

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

@sharpist I think the 'classic implementation' argument is valid here, but the type really should be int.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AaronRobinsonMSFT this can be changed.
Because these two ways of specifying the return type are equivalent.

I replaced return type 'Int32' -> 'int'
and 'default public parameterless constructors' now deleted

```csharp
// The CLR does not expose a class interface for this type.
// COM clients can call the members of this class using the methods from the IExplicit interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is in the C# snippet, so readers with Visual Basic as the selected language will miss that comment. Moreover, comments are not translated, so this content won't be localized. @sharpist please consider moving this paragraph into the body of the article.

The same is applicable to another snippet update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pkulikov I think these both accompanying comments can be excluded from the code examples. At your discretion. Because the main article already contains a detailed description.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sharpist

I think these both accompanying comments can be excluded from the code examples.

If the article contains enough explanations, I also don't see the need in the code comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

@pkulikov Are you happy with the latest change? I am. I think it's clearer with the explicit interface.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Thraka yes
@sharpist thanks for additional updates

Removed unnecessary comments from edited code examples.
@richlander
Copy link
Member

@AaronRobinsonMSFT and I were going to meet at 10AM PST on Monday (tomorrow). That looks like the best time (10AM) we can select. DM me on twitter @runfaster2000 and we can work out particulars.

@sharpist
Copy link
Contributor Author

Hello, @richlander and Everyone here! I'm only from time to time on twitter but thanks for your twitter and I've seen some your interesting notes on the topic.

Copy link
Contributor

@Thraka Thraka left a comment

Choose a reason for hiding this comment

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

To me this looks like a good improvement and corrects the problem of not actually implementing the explicit interface in the example

@Thraka Thraka merged commit 7aea6a0 into dotnet:master Nov 26, 2018
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.

6 participants