CamelCase vs. underscores: Scientific showdown
11–20 of 60 posts
Re: CamelCase vs. underscores: Scientific showdown
#12Funnily enough if we want to be semantically correct then CamelCase is wrong and camelCase is right.
Re: CamelCase vs. underscores: Scientific showdown
#13As of right now the results are as follows: - CamelCase 52.34% (4,493 votes) - underscores 47.66% (4,092 votes) Which kind of says it all. Use whatever style you want, stop worrying so much about what other people are doing. Variable names a far more important than the formatting you use with them.
If organizations allowed that you'd have no conventions and codebases would be a mess for all involved.
Years ago I moved from_underscores toCamelCase but I'm not vehemently passionate about it and there are plenty of cases where I need to go back to match_conventions.
Re: CamelCase vs. underscores: Scientific showdown
#14The important thing is that the variable names be chosen to facilitate human understanding of the code.
Re: CamelCase vs. underscores: Scientific showdown
#15As of right now the results are as follows: - CamelCase 52.34% (4,493 votes) - underscores 47.66% (4,092 votes) Which kind of says it all. Use whatever style you want, stop worrying so much about what other people are doing. Variable names a far more important than the formatting you use with them.
I think "use whatever style you want" is a fair ethos for personal projects but the truth is it never works for teams. If organizations allowed that you'd have no conventions and codebases would be a mess for all involved. Years ago I moved from_underscores toCamelCase but I'm not vehemently passionate about it and there are plenty of cases where I need to go back to match_conventions.
Re: CamelCase vs. underscores: Scientific showdown
#16As of right now the results are as follows: - CamelCase 52.34% (4,493 votes) - underscores 47.66% (4,092 votes) Which kind of says it all. Use whatever style you want, stop worrying so much about what other people are doing. Variable names a far more important than the formatting you use with them.
- CamelCase 43.84% (1,117 votes)
- underscores 56.16% (1,431 votes)
The beginning poll still is still within half a percent of your numbers as of now.
Apparently, people who prefer underscores are more likely to follow through. ;)
Re: CamelCase vs. underscores: Scientific showdown
#17It's possible that with more exposure to underscore_case I would eventually start treating it as one word.
Re: CamelCase vs. underscores: Scientific showdown
#18From the OP's list of "Pro CamelCase": > Camel case is easier to type, and underscores are hard to type. I'll grant it that, but in the context of programming, this does not seem to be a "pro". After all, don't we spend far more time reading code than we do writing code? I'm old, but I'm still surprised at how I have to fight over my reluctance to do something in another language (such as Python) when I remember that…
Agreed, although python convention is for underscores also. According to pep8 "Function names should be lowercase, with words separated by underscores as necessary to improve readability. mixedCase is allowed only in contexts where that's already the prevailing style"
Re: CamelCase vs. underscores: Scientific showdown
#19Personal logic bugfix: if ( thisLooksLikeJavaOrJavaScriptOr/* ... */ ) { youLikeCamelCase = true; votePoll( camelCaseFormatting ); } else if ( this_looks_like_python ) { you_like_underscores = true; vote_poll( underscore_formatting ); } Variable assignments for this particular piece of code: thisLooksLikeJavaOrJavaScriptOr/* ... */ = true; this_looks_like_python = false;
(define this-looks-the-best_To-Me true)
(if this-looks-the-best_To-Me
(do
(setq you-like-flexibility true)
(vote-poll :lisp-formatting)))
If you follow the normal Lisp pattern of mostly one case and '-' for separation, allowed because Lisps/s-expressions allow the use of the normally reserved '-', I think you get the clearest code. See Clojure for a Lisp that breaks up the sea of Lots of Irritating Sets of Parenthesis if that bothers you.Re: CamelCase vs. underscores: Scientific showdown
#20I really like underscores for two word variable names. It only becomes a problem when you have variable names which are overly long, and your eyes have to move further. if(Accounts_Orders_Invoices_Table.Order_Invoice_Number == Order_Invoice_Number){ ...} if(AccountsOrdersInvoicesTable.OrderInvoiceNumber == OrderInvoiceNumber){ ... } But I don't really care that much. I'll just do whatever everyone else is doing. At l…