Solved

Function/sub naming conventions

Posted on 2009-07-13
3
511 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now