Solved

Function/sub naming conventions

Posted on 2009-07-13
3
540 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 125 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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