Moderators: phlip, Moderators General, Prelates
JayDee wrote:Look at my UserName and guess which I pick.
++$_ wrote:Underscores require an extra keystroke to type. Therefore, they are inferior.
Why is there even any debate about this?
Anyway, you could write a perl script to convert between them in case your Current Project requires you to use the other convention.
Note: In Lisp, where dashes are allowed in variable names, that becomes the preferred option (at least for me). For example:
variable-with-long-complex-name instead of VariableWithLongComplexName. Far superior (same number of keystrokes, too!). Too bad that most languages overload - to mean "minus."
EvanED wrote:Me? I'm agnostic. I use UpperCamelCase for classes, and lowerCamelCase for functions and variables. UPPER_UNDERSCORE_CASE is for macros. (Constants that aren't macros follow the lowerCamelCase variant. I reserve UPPERCASE for macros.)
Korandder wrote:I use CamelCase, but this is mostly a side effect of learning Java first.
crazyjimbo wrote:i_find_it_is_much_easier_to_read_something_in_underscores_than_in_camel_case.
ButThenAgainThatMightJustBeMe,YouShouldAllLetMeKnowWhatYouThink.
davean wrote:Korandder wrote:I use CamelCase, but this is mostly a side effect of learning Java first.
Other side effects may include Nausea, migraines, constipation, loss of agility, and sudden death.
++$_ wrote:Underscores require an extra keystroke to type. Therefore, they are inferior.
phlip wrote:Ha HA! Recycled emacs jokes.

public class Person {
private string _name;
public Person(string name) {
_name = name;
}
}
Webzter wrote:I'm debating switching to leading underscores for fields, even though I think they look ugly, because it disambiguates the following for some people
photosinensis wrote:Not to mention difficulties with handling I/O. You'd think that taking arguments from standard input would be easy. You would also be very, very wrong. Seriously, I'm thinking I might just create a class that handles inputs and does absolutely nothing else, then use it in all subsequent Java code of mine.
zenten wrote:Camel Case is a tool of Microsoft.
zenten wrote:Camel Case is a tool of Microsoft.

BurntCornMuffin wrote:Underscores only slow me down, especially since I tend to hit + instead.
crazyjimbo wrote:find_it_is_much_easier_to_read_something_in_underscores_than_in_camel_case.
phlip wrote:Ha HA! Recycled emacs jokes.
Afterwards, too, depending on how many of your variable names start with the same characters as the one you're trying to type. Since some people use prefixes for variable names, this is a serious issue. For example, if the variables in one part of your program are all named "tf_varname", where tf stands for whatever that module is, then you have to type in "tf_" every time, regardless of word completion. You might argue that it's the prefix causing the problem, not the underscore, and you would be correct. However, some people consider prefixes to be good style.enk wrote:++$_ wrote:Underscores require an extra keystroke to type. Therefore, they are inferior.
Well, once, yes. After that, there's something called word completion.
++$_ wrote:enk wrote:++$_ wrote:Underscores require an extra keystroke to type. Therefore, they are inferior.
Well, once, yes. After that, there's something called word completion.
Afterwards, too, depending on how many of your variable names start with the same characters as the one you're trying to type. Since some people use prefixes for variable names, this is a serious issue. For example, if the variables in one part of your program are all named "tf_varname", where tf stands for whatever that module is, then you have to type in "tf_" every time, regardless of word completion. You might argue that it's the prefix causing the problem, not the underscore, and you would be correct. However, some people consider prefixes to be good style.
phlip wrote:Ha HA! Recycled emacs jokes.
Korandder wrote:I use CamelCase, but this is mostly a side effect of learning Java first.
_peterb wrote:Wrong wrong and wrong.
Follow the code conventions of the language you are using rather than imposing your deluded style on other people who have to read your code.
EvanED wrote:Here's an interesting question: what do you do with acronyms?
For instance, would you create a class called XMLParser, or take the .Net standards and do it as XmlParser? What about when doing underscores? XML_parser, Xml_parser, or xml_parser?
(Personally, I like XmlParser and either XML_parser or xml_parser. XMLParser I think makes it harder to find the divisions between the "words".)
Users browsing this forum: No registered users and 3 guests