CamelCase vs underscores: Scientific showdown (2011)
11–20 of 138 posts
Title should mention that the article is from 2011.
Re: CamelCase vs underscores: Scientific showdown (2011)
#12Why can't we just have spaces in our variable names? These are both work arounds.
Re: CamelCase vs underscores: Scientific showdown (2011)
#13Why can't we just have spaces in our variable names? These are both work arounds.
Two space bars?
Re: CamelCase vs underscores: Scientific showdown (2011)
#14Why can't we just have spaces in our variable names? These are both work arounds.
It would make languages like Python quite unreadable as it would be hard to distinguish between variables and keywords!
Re: CamelCase vs underscores: Scientific showdown (2011)
#15Why can't we just have spaces in our variable names? These are both work arounds.
So that the compiler or interpreter knows the extent of the variable token. Without spaces allowed you would need some other way to tell it where they start and end, like quotes or a special declaration, which would be harder for the brain to parse. If you know a better way please share it.
Re: CamelCase vs underscores: Scientific showdown (2011)
#16With an azerty keyboard, underscores are a single stroke of the "8" key. This nullifies the "underscores are hard to type" argument. I'd even wager that the performance results are inverted in my country since snake_case does not require any press of the shift key, unlike camelCase. Also, I'm pretty sure I read a study one time that showed snake_case identifiers to be easier to read than camelCase ones.
Anyways, I think you should follow the specific guidelines of the language you are currently using.
Re: CamelCase vs underscores: Scientific showdown (2011)
#17I find snake case so much easier to read, breathing space between words is there for a reason.
IAgreeThatSnakeCaseIsEasierToRead,ThoughIfWeWereToUseCamelCaseMoreWeWouldBeSavingAGoodAmountOfSpace,WhichMightBeUsefulForNarrowBlocksOfText.I'mSuprisedItHasn'tCaughtOnInProse.Actually,LookingAtThis,MaybeIt'sAGoodThingItHasn'tCaughtOnForProse.
Re: CamelCase vs underscores: Scientific showdown (2011)
#18I use both. Depends on the context.
In Swift (where I spend most of my time), it's CamelCase, or, quite often, dromedaryCase.
Re: CamelCase vs underscores: Scientific showdown (2011)
#19Re: CamelCase vs underscores: Scientific showdown (2011)
#20I got the solution! Given that spaces in identifiers cannot be used because we need to please the language tokenizers (shouldn't be the other way around with humans vs machines?), let's use TAB as a word separator!
Configure TAB width = 1 character, and there you go.