Solved

Function/sub naming conventions

Posted on 2009-07-13
3
559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Stack Overflow Podcast - Frustrating Miracles

In this podcast, Stack Overflow interviewed Linux Academy CEO/Founder, Anthony James, and got his developer story!

"Follow your passion, be prepared to work hard and sacrifice, and, above all, don't let anyone limit your dreams."  - Donovan Bailey

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

635 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