You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since ByVal is the default, it doesn't have to be explicitly specified. I agree with you, @Youssef1313, that is noisy. It also has the unfortunate effect, in my experience, of causing the occasional ByRef keyword to be overlooked. So it would be useful to remove it.
I'll add this item to our backlog and the Community Contributor's project. If you're interested in removing ByVal from some or all of the examples, try to submit PRs that touch a small subset (approximately 100 or so) of files at a time.
@paul1956 , I thought of that. but I'm not sure if unintended removal could be done in an automated solution. For example, the ByVal article itself has a code example, ByVal should NOT be removed there.
I'm not sure if there could be other places where ByVal shouldn't be removed.
I would like to start with correctly documenting line continuation in VB 16 I looked at the special character $ and has a line [!CODE-vbinterpolated-string-symbol] which seems to do no where in the Doc GitHub repo. does [!Code-vb have some special meaning?
[!code-lang....] is used in .md files to include a code sample.
That is how to refer to a code in the samples repo from the docs repo.
but I don't think you will find any [!code-lang...] in the samples repo. (Not very sure)
I was working on the Doc Repo because I didn't see any VB code that needs work, The Doc's need updating for VB 16 and Core 3.0 and it seemed like a good place to start since there are lots of examples.
Which Repo should I be looking at to find the VB code that needs moving? Can you provide a URL for the repo with 100 files that need ByVal removed it will only take a few minutes to do using a code fix I have.
I think you may start with samples repo, surely it has more than 100 files containing ByVal. But the work can be splitted into multiple PRs, each has about 100 files changed as suggested by @rpetrusha
@Thraka, Do you mean the auto generated code like the designer file for winforms for example ?
If yes. Then, In most cases, no one looks at that code. The more important is the code that the developer write himself. It looks much nicer without the noise produced by ByVal.
For the auto generated code, I'm not sure if we can tell the VS team about that to address in later updates ?
From what I understand the snippets in this repo are used to produce the product Snippets so my eliminating them here part of the issue is solved. I agree that eliminating them in all in the templates and the "System." in the Form Boilerplate would be great, not sure where to report the issue.
This issue has been closed as part of the issue backlog grooming process outlined in #22351.
That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the @dotnet/docs team for visibility.
Activity
rpetrusha commentedon Aug 19, 2019
Since
ByValis the default, it doesn't have to be explicitly specified. I agree with you, @Youssef1313, that is noisy. It also has the unfortunate effect, in my experience, of causing the occasionalByRefkeyword to be overlooked. So it would be useful to remove it.I'll add this item to our backlog and the Community Contributor's project. If you're interested in removing ByVal from some or all of the examples, try to submit PRs that touch a small subset (approximately 100 or so) of files at a time.
paul1956 commentedon Aug 20, 2019
There should be a CodeFix for removing ByVal and there may be third party tools that can do it for a whole project.
Youssef1313 commentedon Aug 20, 2019
@paul1956 , I thought of that. but I'm not sure if unintended removal could be done in an automated solution. For example, the ByVal article itself has a code example,
ByValshould NOT be removed there.I'm not sure if there could be other places where
ByValshouldn't be removed.paul1956 commentedon Aug 20, 2019
A CodeFix only operates on "Code" and is smart enough to do the right thing, it can also be interactive.
Youssef1313 commentedon Aug 21, 2019
@paul1956 , I'll try to do that soon when I get free time and see if I could get good results.
paul1956 commentedon Aug 22, 2019
I would be happy to post/contribute a standalone remove ByVal analyzer and refactoring if you think its interesting. It is very small.
Youssef1313 commentedon Aug 22, 2019
Well, you can start that anytime and submit a small PRs ( as suggested by @rpetrusha ) if you want and they will review it, @paul1956 .
paul1956 commentedon Aug 22, 2019
I would like to start with correctly documenting line continuation in VB 16 I looked at the special character $ and has a line [!CODE-vbinterpolated-string-symbol] which seems to do no where in the Doc GitHub repo. does [!Code-vb have some special meaning?
Youssef1313 commentedon Aug 22, 2019
[!code-lang....] is used in .md files to include a code sample.
That is how to refer to a code in the samples repo from the docs repo.
but I don't think you will find any [!code-lang...] in the samples repo. (Not very sure)
The file you mentioned is here
paul1956 commentedon Aug 22, 2019
Tried doing a Pull Request and I get Error 500

paul1956 commentedon Aug 22, 2019
I was working on the Doc Repo because I didn't see any VB code that needs work, The Doc's need updating for VB 16 and Core 3.0 and it seemed like a good place to start since there are lots of examples.
paul1956 commentedon Aug 22, 2019
Which Repo should I be looking at to find the VB code that needs moving? Can you provide a URL for the repo with 100 files that need ByVal removed it will only take a few minutes to do using a code fix I have.
Youssef1313 commentedon Aug 22, 2019
I think you may start with samples repo, surely it has more than 100 files containing
ByVal. But the work can be splitted into multiple PRs, each has about 100 files changed as suggested by @rpetrushapaul1956 commentedon Aug 23, 2019
Many of the sample use older project formats, is it OK to upgrade to latest format? Eventually to get on Core will require format changes anyway.
Thraka commentedon Sep 13, 2019
FYI The automatic code inserted by visual studio snippets and autocomplete insert ByVal.
Youssef1313 commentedon Sep 13, 2019
@Thraka, Do you mean the auto generated code like the designer file for winforms for example ?
If yes. Then, In most cases, no one looks at that code. The more important is the code that the developer write himself. It looks much nicer without the noise produced by
ByVal.For the auto generated code, I'm not sure if we can tell the VS team about that to address in later updates ?
paul1956 commentedon Sep 14, 2019
From what I understand the snippets in this repo are used to produce the product Snippets so my eliminating them here part of the issue is solved. I agree that eliminating them in all in the templates and the "System." in the Form Boilerplate would be great, not sure where to report the issue.
Thraka commentedon Sep 15, 2019
No I was thinking of something else, never mind :)
dotnet-bot commentedon Jan 25, 2021
This issue has been closed as part of the issue backlog grooming process outlined in #22351.
That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the
@dotnet/docsteam for visibility.