:snake: SNAKE_CASE_GANG :snake:

it has the best readability. and i spend most of my time in c or python. and i hate hitting shift ;)

@yogthos
8
edit-2
4M

kebab-case-is-just-as-readable, unfortunately not an option in c or python :)

@avalos
cake
24M

!usernamechecksout

Dessalines
admin
94M

Doesn’t matter to me, but I like that rust has built in enforcement of consistent naming conventions for functions, traits, etc.

@nromdotcom
84M

I like whatever the accepted standard is for the language I’m using at the time.

So for python and ruby we’re talking snake_case variables and PascalCase classes, for javascript camelCase variables and PascalCase constructors, for go camelCase for unexported and PascalCase for exported.

Don’t really see how one might have a personal favorite that they apply to all languages equally.

Yeah, the best is when a language already has a standard formatting and that is used by every library. Good examples are Go and Rust which have an “official” formatting tool that is developed. So you can just stick to it and not think about it.

Consistency is the most important part, the rest matters a lot less.

Adda
14M

Exactly this. I have lacked this comment here and was surprised no one has mentioned it earlier. One might prefer one format over the other, whenever there is a standard though, one should immediately switch to it and stick with the standard for the given language. Not what the discussion asked for though, so that might be the reason.

@t_var_s
54M

snake_case for variable names because they seem to be holding something in their underscores. camelCase for functions because verbNoun looks good. PascalCase for classes because it looks like it’s a level above that needs to be instantiated before getting used.

@yogthos
54M

Kebab case hands down, it’s as readable as snake case, but easier to type. Unfortunately, it’s rarely seen outside Lisps.

Ravn
54M

Also looks neater and more streamlined. I find snake case gives the feeling of everything being a bit imbalanced with all those underscores weighing everything down.

@ksynwa
24M

Yeah you’re right it is much easier to type. Wish more languages had this.

My primary programming language has been Python since 2008, so the answer is obvious. Though I like consistency even more, so CamelCase is also ok when used everywhere.

@gracelmul
24M

Basically what Rust has

@Talkless
24M

I use CamelCase::likeQtDoes(), probably just because Qt does so, as 99% work done by using Qt library.

@kaosfang_
14M

Probably camelCase is what i use most, but if im working withsome who likes snake_case im fine with that as well

i like any that doesnt involve me hitting - or _ since its really annoying to reach for that key. also visually i like camelCase the most

@Reaton
14M

I used to use camelCase because I learned to write variable names like that but now I find that snake_case has a better readability.

@Lowey
14M

Like_This can’t remember name

@zksmk
34M

Cake case (camel+snake=cake).

@glennsl
5
edit-2
4M

deleted by creator

@ufrafecy
2
edit-2
2M

deleted by creator

@sia
1
edit-2
4M

deleted by creator

please tell me you’re joking. how do you even go back to a code you wrote a year earlier?

@sia
1
edit-2
4M

deleted by creator

Ravn
1
edit-2
4M

deleted by creator

Ravn
1
edit-2
4M

deleted by creator

General Programming Discussion
!programming

    A general programming discussion community.

    Rules:

    1. Be civil.

    Other programming communities:

    • /c/rust
    • /c/python
    • /c/powershell
    • /c/haskell
    • /c/fpcomplete
    • /c/cpp
    • /c/c_programming
    • /c/julia
    • 0 users online
    • 4 users / day
    • 9 users / week
    • 24 users / month
    • 187 users / 6 months
    • 2372 subscribers
    • 626 Posts
    • 811 Comments
    • Modlog