Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Function/sub naming conventions

Posted on 2009-07-13
3
Medium Priority
?
564 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 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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