3

In Computer Programming, the programmer most often declare a variable or function with series of underscores.For instance,

  • english_dot_stack_exchange.

Is there a style name for that kind of sentences/words with series of underscores/understrike/low line/low dash?

EDIT:

I would like to know the style's name.Just like camelCase.

8
  • 2
    If you're asking for a name for the style (using_underscores as opposed to camelCase), Wikipedia calls it underscore-based (Wikipedia, "CamelCase," under "History->Computer Programming->The 'Lazy Programmer' theory")
    – zpletan
    Apr 2, 2012 at 21:22
  • Let me ask you(person who downvoted this qn) one thing.Can you provide some reason,Why does this question is not useful? Apr 3, 2012 at 5:04
  • @VijinPaulraj: I have not downvoted the question, but I guess it boils down to this. I personally don't feel this question as off-topic, but I guess non-programmers may feel that way.
    – nico
    Apr 3, 2012 at 16:37
  • Please clarify: Do you want a generic name for the sentences/words with underscores themselves, or do you want a name for such a style of naming? Apr 3, 2012 at 17:17
  • @FrustratedWithFormsDesigner,style of naming..just like camelCase.. Apr 4, 2012 at 16:34

4 Answers 4

4

Name you're looking for is snake_case. - Wikipedia

Snake case (or snake_case) is the practice of writing compound words or phrases in which the elements are separated with one underscore character (_) and no spaces, with each element's initial letter usually lowercased within the compound and the first letter either upper or lower case—as in "foo_bar" and "Hello_world".

0

I had a CS teacher who called them engineer's spaces, but I doubt that it was common usage. Stroustrup just calls them, "underscores to separate words in an identifier." I feel like if there were a common name, he would know about it and use it, so wikipedia's underscore-based is probably the best you're going to get.

0

As far as I know and can research in 5 minutes, there isn't even a concise term for it in the computing world where it's still common in certain programming languages; it's just a "lowercase underscored identifier". You might hear of it as "Hungarian notation", but that term relates almost exclusively to the identification of the type and scope of a variable identifier in the name of the identifier itself; "li_local_integer" is Hungarian notation but so is "lintLocalInteger".

The use, obviously, is to avoid whitespace, which is in many languages a de facto division between code elements (keywords, identifiers, sometimes operators). While "camelCasing" and "PascalCasing" as conventions for similar situations have the eponymous terms, there isn't a single catchy term for identifiers that use underscores.

Perhaps "lower_score", "Cap_Score" and "UPPER_SCORE" could be introduced, but as the use of underscores to separate identifiers in actual code is a deprecated style in most of the popular languages, it's unlikely to catch on.

1
  • Deprecated?! What about Python, and I think javascript and Ruby?
    – rlms
    Feb 2, 2014 at 20:38
-1

If you want a name for the style of "sentences/words with series of underscores/understrike/low line/low dash", I'd go with "underscored", as I've heard that in use.

Example:

Please make sure all database tables are named in an underscored fashion.

5
  • 1
    Can someone explain the downvoting on these answers? Apr 2, 2012 at 20:58
  • 1
    I can't explain it. A string of words joined by underscores has no meaning in standard English - it's just something encouraged by programming languages. So I don't see how you can call it anything other than a symbol (or perhaps, identifier, but that won't be correct in all contexts). Cornbread's CamelCase is an interesting digression, but this looks like the only plausible "answer" to me. Apr 2, 2012 at 21:23
  • 1
    @FrustratedWithFormsDesigner: he is asking for the name of a specific style in naming variables in programming. symbol, although not wrong is not a specific name for that style, as it also applies to the camelCased version of the variable's name (and to any other style).
    – nico
    Apr 3, 2012 at 16:26
  • 1
    @nico: It's not entirely clear to me if the OP is asking for a term for "sentences/words with series of underscores/understrike/low line/low dash" or a term that refers to the style of such sentences/words, but the first interpretation seemed most likely to me. Apr 3, 2012 at 17:15
  • @FrustratedWithFormsDesigner: I would propend for the second, otherwise I agree that the question would be pointless.
    – nico
    Apr 3, 2012 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.