Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Function/sub naming conventions

Posted on 2009-07-13
3
Medium Priority
?
573 Views
Last Modified: 2012-06-21
Hey guys,

I come from a java background and I'm wondering about naming conventions used in subs/functions in .Net suite, mainly VB.Net

For the mutators i'm used to: setSomething() {}

Accessors: getSomeData() {}

Booleans: isSomethingSetToTrue() {}

This doesn't quite work in VB.Net, mostly because I never really worked with .Net controls.

0
Comment
Question by:Inglorious
3 Comments
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 375 total points
ID: 24837873
hi Inglorious,

                   Check these useful links.


NET Programming Standards and Naming Conventions:

http://www.irritatedvowel.com/Programming/Standards.aspx

VB.NET (Naming Conventions For VB.NET 2005 ):

http://www.mis.uwec.edu/keys/Teaching/is304/wncNET.htm

Naming guidelines and code conventions:

http://dotnet.mvps.org/dotnet/faqs/?id=namingconventions&lang=en


Thanks.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 24837903
There is no naming conventions at all for "mutators" and "accessors". This are known as "properties" in the .net world (any .net language).
For vb, you can define a property with "getters" and "setters" the following way:

Tutorial: http://www.vbdotnetheaven.com/Uploadfile/rajeshvs/PropertiesInVbDotNet04192005060237AM/PropertiesInVbDotNet.aspx
Public Property X() As Integer
   Get
     Return x
   End Get
   Set(ByVal Value As Integer)
     x = value
   End Set
End Property

Open in new window

0
 
LVL 12

Expert Comment

by:GuitarRich
ID: 24837907
Personally I like the first set of conventions listed - they work in both VB & C# and I find the code very readable sticking to those - but as always with naming conventions - its mostly personal preference and the discussions usually get a little heated :)

The conventions your used to should work in VB.net you just have to remember that unlike java & c# vb.net isn't case sensitive.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Integration Management Part 2
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question