DEV Community

loading...

What do you prefer for your variable names? camelCase or snake_case?

lffg profile image Luiz Felipe Gonçalves ・1 min read

I so badly wished JavaScript to be snake_case by convention...

Discussion (6)

Collapse
ahferroin7 profile image
Austin S. Hemmelgarn

Whichever the language itself prefers, because consistency is a good thing.

I tend towards snake case by default out of habit, but I tend to not use multi-word variable names (multi-word function names, however, I use a lot).

Collapse
codenutt profile image
Collapse
jenc profile image
jen chan

Also into camelcase but it must be JS convention and if I knew a different language maybe that would change...

Collapse
codenutt profile image
Jared

It is but its common in other languages too, e.g. Kotlin/Swift :)

Collapse
tahatesser profile image
Taha Tesser

camelCase all day

Collapse
vickilanger profile image
Vicki (she/her)

snake_case because it’s Python convention.

I’m not a fan of camelCase. Like smashing words together ever made sense... I also avoid JavaScript.

Forem Open with the Forem app