6
dcprm
5y

There are mainly two cases (up to my knowledge) for naming variables. `snake_case` and `CamelCase` but some how we managed to add another one. Snake_Camel_Case_Combined. e.g. That_Weird_Variable_Name is so annoying to use.

Comments
  • 1
    Oh my...
  • 1
    There's also

    veryconfusingvariablename (lowercase)

    IAMACONSTANTMUHAAHA (uppercase)

    Both quite frequently used in FLOSS JS/TS. Not like snake cased constants or camelCased variable names.. Not all the time.

    BTW.. I think I've also managed to use another one (used for 'important' things):

    MyVariableName

    But I'm not sure if it's a convention already 🤔
  • 2
    Snake_Camel_Case_Combined was also how old PHP frameworks implemented namespaces back when PHP didn't have namespaces.

    Like Zend Framework 1 for example:

    https://framework.zend.com/manual/...
  • 0
    @ethernetzero I didn’t know that.
  • 2
    @dcprm The more you know… 😄
  • 0
    I use snake_case for variables and Camel_Snake for functions.
  • 0
    @Fast-Nop huh! I have to learn so much.
  • 2
    I recently learned from one of my colleague about one more type of case, he calls it the "kabab-case" and the variables look like my-kabab-variable
    @thepushkarp
  • 0
    @ashutoshsingh05 that’s hilarious. I will definitely want to use it. But languages which I use doesn’t support hyphen in between variable names.
  • 2
    PascalCase
    snake_case
    kebab-case
    camelCase
    l_s_hungarian
Add Comment