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
{{ message }}
This repository was archived by the owner on Jul 12, 2022. It is now read-only.
What would be some example styling rules for VB? C# has a much broader range of acceptable formats, whereas VB has much of its rules about style built into the language itself.
I think for actual code formatting we should prefer the behavior of the pretty lister. This is the standard by which the over whelming majority of VB developers write their code.
Is valid in the VS2015 CTP5, which allows comments after implicit line continuations.
It can also be used in LINQ Query style.
Dimaddrs=FromiIninvites' go through listLetaddr=Lookup(i)' look it upSelecti,addr
Could potentially change the meaning of the code, or be syntax errors..
@jaredpar
Maybe the Style Guidance should be updated (pre Roslyn). Since now the formatter can access more knowledge of what the source text actual represents.
The aims should;-
less visual clutter whilst preserving the meaning.
Read-ability
Skim-ability
So you can quickly look through / at the code, which makes it easier to spot patterns (which the brain is very good at). Those patterns could then be a target of refactoring.
Don't bring the C-Style of code to VB.net,
Some ain't appropriate.
It can make the code less readable. or ugly.
4 Space indentation? It needed in C-Style so you can spot the enclosing braces.
2 spaces is good enough in VB.net, because if verbosity of character of keyword and constructs. Block constructL Block some code End Block
Well formatted VB.net code can look as good as C-Style code when it's well.
Prefer Single Line for Simple code
We don't always need multiple lines to express our intent.
If...Then....'<---------------| ( <= 80c )
Prefer simplest IF form. Especial if the total width of the single line version is <= 80
So because Visual Studio.chose defaults that appeal to a large number of VB developers that makes them lazy? Sorry, that doesn't follow. Additionally you didn't address the original point I was making; the pretty lister represents the style used by the majority of VB code.
Choosing a style should not be an argument about personal preferences. It should instead be a discussion about making consistent and easily enforcable decisions. Given that the pretty lister already formats most VB code out there, deviating from it would go against the easy enforcement goal.
It would also increase the size of the change necessary to move existing code to the new model. One of the nice items about the code formatter today is that it's actually not that disruptive for C# code. With the exception of renaming private fields and adding explicit modifiers, items which would affect Visual Basic as well, it had little affect on the structure of programs.
I'm not saying we should be bound to the pretty lister strictly. But we should only deviate from it when there is a clear and demonstrable readability win associated with it. I haven't seen any such argument yet.
Thanks for making this request. We've started work on porting some of the shared rules to VB. Expect to hear more from us on VB style in the coming days.
RE: Kraeven said:
...we have a lot of projects in VB (unfortunat[e]ly)
Our open source community is young yet and I think this raises a good opportunity to talk about how we all engage each other here.
First and foremost, the .NET Foundation is and needs to remain a place where all .NET developers feel welcome to participate. That means C# developers, F# developers, and VB developers too. Of course we all have preferences, but, we absolutely do not want to create a culture here where developers feel a need when jumping into conversation to apologize for what languages or technologies they're using or not using, or to make disparaging remarks about Java, or JavaScript, or VB, or C++, or VB6, or anything else to establish any kind of "street cred". You shouldn't feel that when you come here and you have VB.NET code you need to drop a casual insult on the product so that other developers will respect you. There should be an expectation here that you and your inquiries and opinions, provided they are on topic and given in a civil manner are respected and responded to in kind as a matter of course. Remarks like this are at worst inflammatory and at best distracting and send the message to people who use VB (like myself) that the .NET Foundation open source community is hostile and not a place for them and it sends the message to people who don't use VB that they can get cool points here by dumping on it. Neither of those are the right messages to send.
Secondly, it is important to keep in mind that this is a community where developers can engage members of the Microsoft product teams who work directly on a number of products, including VB and you never know when someone who is or has worked on a product, such as VB, may be listening or may even be the very person you're soliciting help from or making a suggestion to. For example, both Jared and I are members of the Visual Basic Language Design team. I've been a huge VB fan and advocate personally and professionally for years (even before joining Microsoft), have worked on the VB compiler as part of the "Roslyn" project for five years, and coincidentally own figuring out whether and how to extend the VB styling guidelines already provided by the formatter/pretty-lister. Jared has owned or worked in parts of the VB compiler, IDE, and debugger for many more years than that. We and dozens of others have worked very hard and very passionately on VB for years and we take an incredible amount of pride in that work and VB and its community just as much as we do in C# and F# and those communities. And by "take pride in" I mean we're fans who have VB T-shirts, and VB coffee mugs, and VB banners in the hallways who use VB daily and delight in the opportunity to do so (and to be clear, most of us, particularly on the Managed Languages team work on and in more than one language). When you flippantly insult a product that dozens of people have poured a lot of love into in a forum that's kept vibrant in part by the dialog between consumers and those product owners you run the risk of creating either disengaged or defensive product group team members, neither of which contributes positively to the health of the .NET open source community.
In summary, let's keep this place fun, positive, and welcoming for everyone invested in .NET and its future and leave the language bashing and all the other stuff outside, ok?
Warmest regards,
Anthony D. Green
Program Manager Visual Basic, C#, and F# Languages Team
Oh sorry, I really didn't 't mean it that way. I love VB.. Clear and very
readable.. It's a pity that it's not so popular, most tools and plugins are
focused on other languages, people tend to dismiss the power that lies
underneath just because C# has the masses acceptance. Thanks for answering
my request, I really appreciate it.
Thanks for making this request. We've started work on porting some of the
shared rules to VB. Expect to hear more from us on VB style in the coming
days.
RE: Kraeven said:
...we have a lot of projects in VB (unfortunat[e]ly)
Our open source community is young yet and I think this raises a good
opportunity to talk about how we all engage each other here.
First and foremost, the .NET Foundation is and needs to remain a place
where all .NET developers feel welcome to participate. That means C#
developers, F# developers, and VB developers too. Of course we all have
preferences, but, we absolutely do not want to create a culture here where
developers feel a need when jumping into conversation to apologize for what
languages or technologies they're using or not using, or to make
disparaging remarks about Java, or JavaScript, or VB, or C++, or VB6, or
anything else to establish any kind of "street cred". You shouldn't feel
that when you come here and you have VB.NET code you need to drop a casual
insult on the product so that other developers will respect you. There
should be an expectation here that you and your inquiries and opinions,
provided they are on topic and given in a civil manner are respected and
responded to in kind as a matter of course. Remarks like this are at worst
inflammatory and at best distracting a nd send the message to people who
use VB (like myself) that the .NET Foundation open source community is
hostile and not a place for them and it sends the message to people who
don't use VB that they can get cool points here by dumping on it. Neither
of those are the right messages to send.
Secondly, it is important to keep in mind that this is a community where
developers can engage members of the Microsoft product teams who work
directly on a number of products, including VB and you never know when
someone who is or has worked on a product, such as VB, may be listening or
may even be the very person you're soliciting help from or making a
suggestion to. For example, both Jared and I are members of the Visual
Basic Language Design team. I've been a huge VB fan and advocate personally
and professionally for years (even before joining Microsoft), have worked
on the VB compiler as part of the "Roslyn" project for five years, and
coincidentally own figuring out whether and how to extend the VB styling
guidelines already provided by the formatter/pretty-lister. Jared has owned
or worked in parts of the VB compiler, IDE, and debugger for many more
years than that. We and dozens of others have worked very hard and very
passionately on VB for years and we take an incredible amount of pride in
that work and VB and its community just as much as we do in C# and F# and
those communities. And by "take pride in" I mean we're fans who have VB
T-shirts, and VB coffee mugs, and VB banners in the hallways who use VB
daily and delight in the opportunity to do so (and to be clear, most of us,
particularly on the Managed Languages team work on and in more than one
language). When you flippantly insult a product that dozens of people have
poured a lot of love into in a forum that's kept vibrant in part by the
dialog between consumers and those product owners you run the risk of
creating either disengaged or defensive product group team members, neither
of which contributes positively to the health of the .NET open source
community.
In summary, let's keep this place fun, positive, and welcoming for
everyone invested in .NET and its future and leave the language bashing and
all the other stuff outside, ok?
Warmest regards,
Anthony D. Green
Program Manager
Visual Basic, C#, and F# Languages Team
—
Reply to this email directly or view it on GitHub.
Activity
jmarolf commentedon Feb 10, 2015
What would be some example styling rules for VB? C# has a much broader range of acceptable formats, whereas VB has much of its rules about style built into the language itself.
Salz150 commentedon Feb 11, 2015
Couple of things I can think of
Use only one statement per line. Don't use the Visual Basic line separator character (:).
For example
System.Threading.Thread.Sleep(Sleep) : AttemptFailure = True : TryAttempt += 1 : AttemptEX = ex
becomes
System.Threading.Thread.Sleep(Sleep)
AttemptFailure = True
TryAttempt += 1
AttemptEX = ex
Comments on seperate lines.
For example
Dim foo As Integer ' foo is an integer.
becomes
' foo is an integer.
Dim foo As Integer
There are more here: "Visual Basic Coding Conventions"
jaredpar commentedon Feb 12, 2015
I think for actual code formatting we should prefer the behavior of the pretty lister. This is the standard by which the over whelming majority of VB developers write their code.
AdamSpeight2008 commentedon Feb 12, 2015
@Salz150 Enforcing comments being on a newline.
Is valid in the VS2015 CTP5, which allows comments after implicit line continuations.
It can also be used in LINQ Query style.
Could potentially change the meaning of the code, or be syntax errors..
@jaredpar
Maybe the Style Guidance should be updated (pre Roslyn). Since now the formatter can access more knowledge of what the source text actual represents.
The aims should;-
So you can quickly look through / at the code, which makes it easier to spot patterns (which the brain is very good at). Those patterns could then be a target of refactoring.
Don't bring the C-Style of code to VB.net,
2 spaces is good enough in VB.net, because if verbosity of character of keyword and constructs. Block constructL
Block
some codeEnd Block
Prefer Single Line for Simple code
We don't always need multiple lines to express our intent.
Prefer simplest IF form. Especial if the total width of the single line version is
<= 80
Rather that the 3 line version.
Rationale: Guard Statements
Simple Case-Clauses
Break Method Parmeters at 80c limit
Method should be broken at the 80c, then placed on then following.
eg
Align Assignment
source
note: My personal version of Roslyn is structured slight differently, but it's a lot easier to glance over.
AdamSpeight2008 commentedon Feb 12, 2015
Nope, That's the default setting in VS and programmers are inherently lazy.
jaredpar commentedon Feb 12, 2015
@AdamSpeight2008
So because Visual Studio.chose defaults that appeal to a large number of VB developers that makes them lazy? Sorry, that doesn't follow. Additionally you didn't address the original point I was making; the pretty lister represents the style used by the majority of VB code.
Choosing a style should not be an argument about personal preferences. It should instead be a discussion about making consistent and easily enforcable decisions. Given that the pretty lister already formats most VB code out there, deviating from it would go against the easy enforcement goal.
It would also increase the size of the change necessary to move existing code to the new model. One of the nice items about the code formatter today is that it's actually not that disruptive for C# code. With the exception of renaming private fields and adding explicit modifiers, items which would affect Visual Basic as well, it had little affect on the structure of programs.
I'm not saying we should be bound to the pretty lister strictly. But we should only deviate from it when there is a clear and demonstrable readability win associated with it. I haven't seen any such argument yet.
Salz150 commentedon Feb 12, 2015
@AdamSpeight2008 good point about inline comments - I didn't think that through.
@jaredpar good point about the
:
- I guess it's in there for a reason. :)I like the ideas about aligning assignment operators and breaking method parameters at 80c.
Begin support for VB.Net
AnthonyDGreen commentedon Feb 16, 2015
Hey @Kraeven,
Thanks for making this request. We've started work on porting some of the shared rules to VB. Expect to hear more from us on VB style in the coming days.
RE: Kraeven said:
Our open source community is young yet and I think this raises a good opportunity to talk about how we all engage each other here.
First and foremost, the .NET Foundation is and needs to remain a place where all .NET developers feel welcome to participate. That means C# developers, F# developers, and VB developers too. Of course we all have preferences, but, we absolutely do not want to create a culture here where developers feel a need when jumping into conversation to apologize for what languages or technologies they're using or not using, or to make disparaging remarks about Java, or JavaScript, or VB, or C++, or VB6, or anything else to establish any kind of "street cred". You shouldn't feel that when you come here and you have VB.NET code you need to drop a casual insult on the product so that other developers will respect you. There should be an expectation here that you and your inquiries and opinions, provided they are on topic and given in a civil manner are respected and responded to in kind as a matter of course. Remarks like this are at worst inflammatory and at best distracting and send the message to people who use VB (like myself) that the .NET Foundation open source community is hostile and not a place for them and it sends the message to people who don't use VB that they can get cool points here by dumping on it. Neither of those are the right messages to send.
Secondly, it is important to keep in mind that this is a community where developers can engage members of the Microsoft product teams who work directly on a number of products, including VB and you never know when someone who is or has worked on a product, such as VB, may be listening or may even be the very person you're soliciting help from or making a suggestion to. For example, both Jared and I are members of the Visual Basic Language Design team. I've been a huge VB fan and advocate personally and professionally for years (even before joining Microsoft), have worked on the VB compiler as part of the "Roslyn" project for five years, and coincidentally own figuring out whether and how to extend the VB styling guidelines already provided by the formatter/pretty-lister. Jared has owned or worked in parts of the VB compiler, IDE, and debugger for many more years than that. We and dozens of others have worked very hard and very passionately on VB for years and we take an incredible amount of pride in that work and VB and its community just as much as we do in C# and F# and those communities. And by "take pride in" I mean we're fans who have VB T-shirts, and VB coffee mugs, and VB banners in the hallways who use VB daily and delight in the opportunity to do so (and to be clear, most of us, particularly on the Managed Languages team work on and in more than one language). When you flippantly insult a product that dozens of people have poured a lot of love into in a forum that's kept vibrant in part by the dialog between consumers and those product owners you run the risk of creating either disengaged or defensive product group team members, neither of which contributes positively to the health of the .NET open source community.
In summary, let's keep this place fun, positive, and welcoming for everyone invested in .NET and its future and leave the language bashing and all the other stuff outside, ok?
Warmest regards,
Anthony D. Green
Program Manager
Visual Basic, C#, and F# Languages Team
Kraeven commentedon Apr 12, 2015
Oh sorry, I really didn't 't mean it that way. I love VB.. Clear and very
readable.. It's a pity that it's not so popular, most tools and plugins are
focused on other languages, people tend to dismiss the power that lies
underneath just because C# has the masses acceptance. Thanks for answering
my request, I really appreciate it.
Got to get me such a T-shirt.. :-)
Keep up the good work!
Kraeven
Op 16 feb. 2015 12:26 PM schreef "Anthony D. Green" <
notifications@github.com>: