Programing Style: camelCase vs snake_case

By Xah Lee. Date: . Last updated: .

Note: this essay is unfinished.

i'm the type of guy who is deeply obsessed with trivia, like, camelCase vs snake_case.

over the past few years, i've eagerly read anything written on the subject that hit me. Here's a few generic ones, discarding those language specific guides.

[An Eye Tracking Study on camelCase and under_score Identifier Styles By Bonita Sharif And Jonathan I Maletic, Department Of Computer Science, Kent State University. At , accessed on 2015-09-07 ]

[To CamelCase or Under_score By Dave Binkley, Marcia Davis, Dawn Lawrie, Christopher Morrell. At , accessed on 2015-04-15 ]

[Why the Twisted coding standard is better than PEP8 (although you still shouldn't care) By Glyph Lefkowitz. At , accessed on 2015-04-15 ]

[IHateCamelCase By Yossi Kreinin. At , accessed on 2015-04-15 ]


Snake case

after reading them all, all the reasons are like hogwash.

Back to early 1990s, i'm deeply a believer of the snake_case. Because, that is a unambiguous and reversible way to map space-separated words into computer languages shortcomings of not allowing space. Some are thinking, lisp-style-with-hyphen-is-best, but actually no, because hyphen is used in English too. So, by using hyphen as separated, you create the ambiguity of a phrase that has hyphen in the first place. For example, stdin_stand-in

Hyphenated Words, page 1

But then, around 2009 or so, i started to like camelCase. Because, it's really convenient to type.

But even so, convenience of typing shouldn't count, because that's the keyboard problem, a completely separate issue, which can be easily solved. For example, i use a emacs key system that ...........

and, but, some say camelCase is harder to read than under_score. That's bullshittish, because, words used in computer lang are identifiers. When you_start_to_to_have_long_names_like_this, the underscore camp gets edgy, because, you are not really writing prose where each words needs to be read-over, but rather, you have a blob of things that you want to easily identify at a glance — identifiers — get it?

If you have a question, put $5 at patreon and message me.