Is it bad to use Underscores in Function Names? Can I know the reason why? ie: Function GET_NAME(byval sword as string) as string
Not at all. The coding convention is a very subjective term. One might feel one coding style great and another find it worse. The key point is maintain one coding style only throughout your code for ease of upcoming developers and maintainers.
However, avoid all caps for function names (as shown in your example). It's generally reserved for macros (C/C++) / constants.
I would use them sparingly in my own API, but to say that they are bad is simply untrue. If so, .NET specifically would have problems with default naming for event handlers!
void Form_Load( //...
void Page_Load( //...
void btn_Click( //...
// etc.
In this specific case, all caps with underscore separators are generally understood to be constant values.
Firstly, its very subjective matter and depends from Person to Person. One may feel like using _ in function, others may not. There's no harm if you use it.
Frankly speaking, you don't usually use _
sign. But, you can to use this '_
' in the variable declaration.
Note : You can check out the
msdn link
( atleast for C#, Visual Basic, C++ )
精彩评论