Name Conventions
-
Hello, When i should to name method with uppercase letter and when not? When I should use getValue() and when GetValue()? Thanks.
camelCase for members, variables, and parameters. PascalCase for methods, Events, and Properties. Of course we all know that Java style is far superior I don't know why the folks at MS tried to dictate a different style.
File Not Found
-
I typically use an prefixed underscore to indicate private/protected members :) Not that anyone would care :P
I finally got a job doing something I enjoy and I"m good at...15 hour days seem like play time :P
I thought we were talking about methods. For variables and properties, I do the same. upper/lower case differences are not enough to be CLS compiant, because VB sucks.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
camelCase for members, variables, and parameters. PascalCase for methods, Events, and Properties. Of course we all know that Java style is far superior I don't know why the folks at MS tried to dictate a different style.
File Not Found
Ennis Ray Lynch, Jr. wrote:
I don't know why the folks at MS tried to dictate a different style.
Because Not Invented Here is alive and rampant at Microsoft. They just, a priori, know what's right.
The evolution of the human genome is too important to be left to chance idiots like CSS.
-
Hello, When i should to name method with uppercase letter and when not? When I should use getValue() and when GetValue()? Thanks.
http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
I thought we were talking about methods. For variables and properties, I do the same. upper/lower case differences are not enough to be CLS compiant, because VB sucks.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
Christian Graus wrote:
CLS compiant, because VB sucks.
Wrong, it is because CLS==language independence, a feature it boasts off over Java bytecode. BTW, it is your perfect C# compiler that will complain. If you write and consume your components only in C#, just remove the CLS compliant attribute, and stop blaming VB for your bugs ;P With love, Paul.
Jesus Christ is LOVE! Please tell somebody.
-
I typically use an prefixed underscore to indicate private/protected members :) Not that anyone would care :P
I finally got a job doing something I enjoy and I"m good at...15 hour days seem like play time :P
Hockey wrote:
I typically use an prefixed underscore
Code-Frog:So if this is Pumpkinhead. Time for him to run and hide. It's an interesting thought really.
-
Use getValue() in Java and GetValue() in .NET
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
How about in VB ? ;P
"Courage choose who will follow, Fate choose who will lead" - Lord Gunner, Septerra Core "Press any key to continue, where's the ANY key ?" - Homer Simpsons Drinking gives me amazing powers of insight. I can solve all the worlds problems when drunk, but can never remember the solutions in the morning. - Michael P Butler to Paul Watson on 12/08/03
-
How about in VB ? ;P
"Courage choose who will follow, Fate choose who will lead" - Lord Gunner, Septerra Core "Press any key to continue, where's the ANY key ?" - Homer Simpsons Drinking gives me amazing powers of insight. I can solve all the worlds problems when drunk, but can never remember the solutions in the morning. - Michael P Butler to Paul Watson on 12/08/03
Use GetValue() in VB - ....although if you are a proper VB programmer you'll probably be a bit more explicit about what the
Value
is...'--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
Use getValue() in Java and GetValue() in .NET
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
Hockey wrote:
I typically use an prefixed underscore
Code-Frog:So if this is Pumpkinhead. Time for him to run and hide. It's an interesting thought really.
I think that applies to public members/fields only.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
-
Christian Graus wrote:
CLS compiant, because VB sucks.
Wrong, it is because CLS==language independence, a feature it boasts off over Java bytecode. BTW, it is your perfect C# compiler that will complain. If you write and consume your components only in C#, just remove the CLS compliant attribute, and stop blaming VB for your bugs ;P With love, Paul.
Jesus Christ is LOVE! Please tell somebody.
Paul Selormey wrote:
Wrong, it is because CLS==language independence, a feature it boasts off over Java bytecode.
True -and to make it language independant, they needed to make it case insensitive. Which languages are case insensitive ?
Paul Selormey wrote:
BTW, it is your perfect C# compiler that will complain.
Of course it will. The VB.NET compiler is too stupid to see a difference between var, Var and VAR to start with.
Paul Selormey wrote:
just remove the CLS compliant attribute,
I've been known to do that, actually
Paul Selormey wrote:
and stop blaming VB for your bugs
ROTFL - you're obviously kidding around, but either way, I think a language being case insensitive is just plain dumb. It's obviously a 'feature' added to VB.NET to make it easier, it's not something that has a real advantage beyond that.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
Hockey wrote:
I typically use an prefixed underscore
Code-Frog:So if this is Pumpkinhead. Time for him to run and hide. It's an interesting thought really.
However, an underscore in any other position in an element name is CLS-compliant.
So it only matters for public properties/methods which I don't think they do. Just for fields like I do.
-
However, an underscore in any other position in an element name is CLS-compliant.
So it only matters for public properties/methods which I don't think they do. Just for fields like I do.
Steve Hansen wrote:
However, an underscore in any other position in an element name is CLS-compliant.
I understood this as
_element
is invalid, butelement_
,my_element
etc are OK.Steve Hansen wrote:
So it only matters for public properties/methods which I don't think they do.
Agreed.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
-
Hello, When i should to name method with uppercase letter and when not? When I should use getValue() and when GetValue()? Thanks.
Be consistent. If maintaining, adapt (even if it's wrong -- or rewrite the whole lot, there are beautifiers). As you gather wisdom, you will develop your own style;) I heard about a company using beautifiers. Many of the coders had their own style and instead of going to war over brackets and spaces the company decided on what style the code should comfirm to when checked in. What style each and one of the coders used when working on their parts was irrelevant. rgds /Jonas
-
I typically use an prefixed underscore to indicate private/protected members :) Not that anyone would care :P
I finally got a job doing something I enjoy and I"m good at...15 hour days seem like play time :P
OMG. There's another one us out there that uses this convention. I'm not alone anymore. (sniff)
Software Zen:
delete this;
-
I thought we were talking about methods. For variables and properties, I do the same. upper/lower case differences are not enough to be CLS compiant, because VB sucks.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
OMG. There's another one us out there that uses this convention. I'm not alone anymore. (sniff)
Software Zen:
delete this;
I do, but only for private members. As has been written elsewhere, underscores on protected members will raise errors because they are not CLS Compliant.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
I do, but only for private members. As has been written elsewhere, underscores on protected members will raise errors because they are not CLS Compliant.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.Our naming conventions are something like this:
PascalCase
for public classes, members, 'file'static
values, and globals._PascalCaseWithLeadingUnderscore
for private/protected classes and members.camelCase
orlower_case_with_underscores
for local variables.ALL_UPPER_CASE_FOR_DEFINES
which are required to be manifest constants only. If we ever start doing .NET development (we're currently a C++/MFC house), we may need to modify our conventions. .NET enforcing a naming convention is annoyingly reminiscent of the Ada development tools I had to deal with back in the late 80's. They were equally obnoxious about requiring adherence to some academic's notion of proper programming technique. I am of the "Grady Booch must die" programming school, myself :|.
Software Zen:
delete this;
-
Ennis Ray Lynch, Jr. wrote:
I don't know why the folks at MS tried to dictate a different style.
Because Not Invented Here is alive and rampant at Microsoft. They just, a priori, know what's right.
The evolution of the human genome is too important to be left to chance idiots like CSS.
Tim Craig wrote:
They just, a priori, know what's right
How does an 800 pound gorilla write software? (wait for it) However he likes.
Software Zen:
delete this;
-
Christian Graus wrote:
CLS compiant, because VB sucks.
Wrong, it is because CLS==language independence, a feature it boasts off over Java bytecode. BTW, it is your perfect C# compiler that will complain. If you write and consume your components only in C#, just remove the CLS compliant attribute, and stop blaming VB for your bugs ;P With love, Paul.
Jesus Christ is LOVE! Please tell somebody.
Paul Selormey wrote:
Wrong, it is because CLS==language independence, a feature it boasts off over Java bytecode.
Off topic: Java bytecode is language independent as well, and there are some very nice languages that target JVM, such as Scala[^], Nice[^] and Groovy[^]. Note that I don't count Java as a nice language for JVM ;)