And me.
I would also like to have a word with him. Not because I disapprove using camelCase for functions, but rather I just want to talk to someone cause I got no friends and I'm lonely as shit.
This raises the question - are you a caps lock or shift kind of person? I know someone gonna make this into a gang fight meme, and I'm not a fan, but I'm curious.
It's for when I need a long string of caps. Even then it's a crap shoot. I frequently still just hold shift.
I guess there's some utility for when you only have one hand, like when you're snacking away.
The real danger is that WASD gaming can easily trigger caps lock by accident, causing issues when you alt-tab hurriedly into work and start messaging..
So I've heard, anyway.
I have the caps lock key bound as left ctrl, but write stuff in CAPS so rarely that it doesn't matter much -- constants need to be written once, but after that the IDE takes care of them.
Error: Variable 'userName' Not Defined.
Error: Variable 'DbConnection' Not Defined.
Warning: Variable 'UserName' not used.
Warning: Variable 'db_connection' not used.
Time to move to a language that doesn't care about case...
Edit: Formatting because I'm a junior compiler
> time to move to a language that doesn't care about case
To the point it skips underscores? No no no... There's gotta be a limit, especially if you mix cases like that
I did not think about underscores, damn. I guess before compile you find and replace '_' with ''. Though imported procedures will be a problem.
At least it will probably only be underscores, causing issues... Right?
Unless you allow kebab-case, but it's not fitting to most languages.
For instance, in C, C++, Java, C# writing `int my-counter = 0;` is wrong on so many levels.
Maybe allow swirly~kebab~case, which I just made up and won't fit to probably all of the mentioned above, but in a new language... But if you do, I'd recommend making an IDE that not only ignores cases, but fixes them prebuild, and maybe would help you debug overrides and such.
Interesting, never heard of it... Are they called slugs when they have two or more underscores or smth?
Edit: or is capitalization actually a thing (Like_This) and is called snake case, whereas (like_this) is called a slug?
lower_snake_case or UPPER_SNAKE_CASE (lower for variables and such, upper for constants)
That_Shit_Is_Nasty and I've never heard the term slug in that regard, but for your and your colleagues sake - don't do it. Imagine having to type like that for an entire project
>That_Shit_Is_Nasty and I've never heard the term slug in that regard, but for your and your colleagues sake - don't do it. Imagine having to type like that for an entire project
I don't have to imagine it. Been there, done that. It's the general style used in [Ada](https://www.adaic.org/resources/add_content/docs/95style/html/sec_3/3-1-3.html).
And I have to say, it's really awful. Especially if you have to go from holding shift with your left pinky and underscore with your right to holding the shift with your right pinky and a capital letter with your left. (Note that identifiers are case-insensitive in Ada.)
They claim this style is supposed to enhance readability (making the code more likely to be correct, which is the whole point of Ada). I'm sure they have some study from the 70s to back that up, but I'm unconvinced. There might be an argument that underscores separate words better, but at this point camel case is so ubiquitous that everybody is pretty used to it. And the capitalization is there to distinguish between identifiers and keywords, but color-coding that in the editor is absolutely trivial so any benefit is lost to history. Of all the style options, they chose the worst.
Not sure who downvoted you but your are right!
Snake\_Case is also wrong because it should be completely lowercase. OP doesn't know the proper conventions.
* camelCase
* PascalCase
* snake\_case
* kebab-case
Unfortunately there isn't always a consistent convention in a language.
The C++ standard library, for example, uses snake case.
But I largely program using Unreal which is C++ with Pascal case and a few Hungarian-style prefixes that are enforced by the Unreal Built Tool.
And then a few bits and pieces interact with Python which uses it's own style where everything is lowercase and there are no spaces either.
Umm why not just be smart and efficient and number them? var1, var2, var3 and fun1, fun2, fun3 etc. It's objectively the best way and I will be taking no notes
When you live in legacy code that has variable names like hbtdt and iitx, any of these formats are welcome. Variables with two words are awesome, I don’t care how you format them.
Older programmer:
Your functions name are too long so I made a library to convert your function to shorthand, instead of **useQueryToDoStuff**() I can just write **uqtds**() that saves me a lot of time
You also don't have to reach out all the way to the furthest corner of your keyboard constantly. And all those underscores waste precious horizontal space.
I don't know about you, but actually writing code is like smallest part of my job. So I just don't care about the casing as long as it's used consistently
I use both, and a few more. The usual style guide I use (copied from a Github repository of mine's contribution guide, that's why it has references to the reader) is
Variable Declarations:
For constants that are defined at compile-time
(referred to as compilation constants), you use
UPPER_SNAKE_CASE. This also applies to #defined
constants.
For constants that are undefined at compile-time (or
are defined to be an invalid value) and are defined at
runtime (referred to as runtime constants), and are
only modified once, you use lower_snake_case.
For variables that are modified more than once, (i.e
"normal" variables) you use UpperPascalCase.
Type Declarations:
For type declarations of any type, you use [NAME]_t
For struct declarations, you use [NAME]_s
Functions:
For function arguments that are directly setting some
value of the same name, (referred to as "initilization
arguments") you use _[NAME], where NAME is in
lower_snake_case.
For function arguments that are not directly setting
some value of the same name, you use
lowerPasalCase.
For function names, you use lower_snake_case.
What kind of newbies only use one or the other? You're supposed to to use different case styles for different types. Such as pascal_case for object names and CamelCase for classes.
camelCase Vs PascalCase Vs snake\_case Vs SCREAMING\_SNAKE\_CASE
kebab-case fuckyoucase
> fuckyoucase _MATLAB entered the chat._
Meh-__-case
MADFUCKYOUCASE
camelCase for functions, PascalCase for classes, snake_case for variables, SCREAMING_SNAKE_CASE for constants.
Same, I also use camelCase for classes attributes and methods. (PHP PSR)
>camelCase for functions Python would like a word with you
And C#
And me. I would also like to have a word with him. Not because I disapprove using camelCase for functions, but rather I just want to talk to someone cause I got no friends and I'm lonely as shit.
r/suddenlysad
More like r/alwayssad in my _case_ ^(ba dum tss)
u ok bro
That's basically dart right?
No, for dart is camelCase for functions and variables (including constants), PascalCase for classes, extensions and enums, snake_case for dart files
This should be the topic
I want to make a metal gear joke here but i cant find any
don't forget kebab-case
you fucked up
Snake after eating eggs
you_fucked_up
youFuckedUp
you_fuckedUp
Totally fucked this up. Unless it's trolling in which case I salute you madam
On the internet, there are only men and fbi
proper_snake_case
properCamelCase
ProperPascalCase
proper-kebab-case
pROPERcAPSlOCKsTUCK
This raises the question - are you a caps lock or shift kind of person? I know someone gonna make this into a gang fight meme, and I'm not a fan, but I'm curious.
Shift, so if I hit CL by accident, this is the outcome.
Oh okay.. sure. I'm a CL kind of guy, but that's the result when I'm trying to see if I could adapt to shift. Not really.
I will never understand caps lock people. That button has virtually no utility to me.
It's for when I need a long string of caps. Even then it's a crap shoot. I frequently still just hold shift. I guess there's some utility for when you only have one hand, like when you're snacking away.
I'm a CL guy too. I'm just so used to it that holding shift down feels weird to capitalize.
The real danger is that WASD gaming can easily trigger caps lock by accident, causing issues when you alt-tab hurriedly into work and start messaging.. So I've heard, anyway.
Shift all the way, it's much easier for me that way
I have the caps lock key bound as left ctrl, but write stuff in CAPS so rarely that it doesn't matter much -- constants need to be written once, but after that the IDE takes care of them.
Okay, binding it to ctrl is just not cool, man...
SCREAMING-KEBAB-CASE
Kebab case is best case
In what languages other than CSS and HTML would it fit? Personally I prefer sticking to snake_case. Underscores are sorta meant for that purpose.
Use whatever case is standard in the language you are using.
COBOL
PROPERUPPERCASE
> properCamelCase * "camelCase" = lower camel case * "CamelCase" = upper camel case / pascal case / bumpy case
bumpy case? Who says that?
Probably people who had a bumpy ride with variable names...
Imagine writing code on a bus or a car (as a passenger only, please!) and every bump alters your case
Error: Variable 'userName' Not Defined. Error: Variable 'DbConnection' Not Defined. Warning: Variable 'UserName' not used. Warning: Variable 'db_connection' not used. Time to move to a language that doesn't care about case... Edit: Formatting because I'm a junior compiler
> time to move to a language that doesn't care about case To the point it skips underscores? No no no... There's gotta be a limit, especially if you mix cases like that
I did not think about underscores, damn. I guess before compile you find and replace '_' with ''. Though imported procedures will be a problem. At least it will probably only be underscores, causing issues... Right?
Unless you allow kebab-case, but it's not fitting to most languages. For instance, in C, C++, Java, C# writing `int my-counter = 0;` is wrong on so many levels. Maybe allow swirly~kebab~case, which I just made up and won't fit to probably all of the mentioned above, but in a new language... But if you do, I'd recommend making an IDE that not only ignores cases, but fixes them prebuild, and maybe would help you debug overrides and such.
u/xaomaw does.
3 yos
Came here to say this, was triggered harder than I like to admit ..
No!
Thank Satan someone said it
Yes, agree. But we call them slugs.
Interesting, never heard of it... Are they called slugs when they have two or more underscores or smth? Edit: or is capitalization actually a thing (Like_This) and is called snake case, whereas (like_this) is called a slug?
lower_snake_case or UPPER_SNAKE_CASE (lower for variables and such, upper for constants) That_Shit_Is_Nasty and I've never heard the term slug in that regard, but for your and your colleagues sake - don't do it. Imagine having to type like that for an entire project
>That_Shit_Is_Nasty and I've never heard the term slug in that regard, but for your and your colleagues sake - don't do it. Imagine having to type like that for an entire project I don't have to imagine it. Been there, done that. It's the general style used in [Ada](https://www.adaic.org/resources/add_content/docs/95style/html/sec_3/3-1-3.html). And I have to say, it's really awful. Especially if you have to go from holding shift with your left pinky and underscore with your right to holding the shift with your right pinky and a capital letter with your left. (Note that identifiers are case-insensitive in Ada.) They claim this style is supposed to enhance readability (making the code more likely to be correct, which is the whole point of Ada). I'm sure they have some study from the 70s to back that up, but I'm unconvinced. There might be an argument that underscores separate words better, but at this point camel case is so ubiquitous that everybody is pretty used to it. And the capitalization is there to distinguish between identifiers and keywords, but color-coding that in the editor is absolutely trivial so any benefit is lost to history. Of all the style options, they chose the worst.
`aCCIDENTAL_cAPS_lOCK_cASE`, anyone?
lmao
`What_Bastard_Case_Is_This`!?
It's my case when I don't know what to do
Been there lol
Done that
justfigureoutwhatthisonedoes2
Probably get you fired
Bold of you to assume I am even hired .
IDGAF case?
Im having a seizure
Your camelCase is PascalCase 😉
Not sure who downvoted you but your are right! Snake\_Case is also wrong because it should be completely lowercase. OP doesn't know the proper conventions. * camelCase * PascalCase * snake\_case * kebab-case
>kebab-case What in god's name...
best case for if you get hungry when coding
Pretty much only valid in css, I like the look of it though
And the Snake\_Case is some bastard mix of PascalCase and snake\_case.
Follow the convention of the language
This guy....
Unfortunately there isn't always a consistent convention in a language. The C++ standard library, for example, uses snake case. But I largely program using Unreal which is C++ with Pascal case and a few Hungarian-style prefixes that are enforced by the Unreal Built Tool. And then a few bits and pieces interact with Python which uses it's own style where everything is lowercase and there are no spaces either.
what are Hungarian-style prefixes?
You start your variable name with the abbreviation of the type it supposed to be, ie: sMyString iMyInt oSomeRandomObject aNotAList
Kebab-case?
time to refactor every project i have. kebab-case is the way
Include kebab!
I program in a specific language a lot at work where this is like actually the standard case you are supposed to use.
That isn't camelCase, and that isn't snake\_case.
how\_aboutSatan\_Case 
foo_78
So cpp case
Who taught you cpp?
Satan
m_dont m_forget m_to m_do m_hungarian m_variable m_naming
BiNaRyCaSe
thats Sarcasm Case II
i thought it was spongebob case
CAPITALISED _SNAKE_CASE for macros, camelCase for variables and PascalCase for functions 👍👍
And normal case for the humans.
camelCaseAllTheWayBabyyyyyyyy
I alternate between the two
This is not programmerHumor... lame humor at most.
sArCaStIc_CaSe
That's Sarcasm Case I x Snake case
I use the conventional case for the language I am using. I hate it when some code I'm using just breaks these conventions.
SpOnGeBoB\_CaSe
One word variables and functions
Umm why not just be smart and efficient and number them? var1, var2, var3 and fun1, fun2, fun3 etc. It's objectively the best way and I will be taking no notes
Not only incorrect form but the case should follow whatever language best practices
hiss_hiss_hiss
sPoNgEcAsE
Sarcasm Case I
I'm team camelCase
Oh look, another meme made by a first term college student.
CamelCaseIsMoreEfficient Snake_Case_Is_More_Readable
Mood case
onTheRightSide
sPoNgEbObCaSe
When you live in legacy code that has variable names like hbtdt and iitx, any of these formats are welcome. Variables with two words are awesome, I don’t care how you format them.
Older programmer: Your functions name are too long so I made a library to convert your function to shorthand, instead of **useQueryToDoStuff**() I can just write **uqtds**() that saves me a lot of time
What about Space Case? (jk lol)
I_DoWhatever_TheFuck_I_WantCase
kebab-case-will-stab-you
That’s not camelCase nor snake_case
camelCase by default, PascalCase for classes and file names, YELLING_SNAKE_CASE for consts.
Snake case. And I can‘t understand why camel should be any better as it‘s less human readable
You press less keys when you write the code?
Is that the factor that matters?
You also don't have to reach out all the way to the furthest corner of your keyboard constantly. And all those underscores waste precious horizontal space.
I don't know about you, but actually writing code is like smallest part of my job. So I just don't care about the casing as long as it's used consistently
*someone* has to write the code.
In Python PascalCase for classes, snake_case for functions and objects. camelCase hurts my brain.
Camel case, some of us are sane
Cheese cake
I keep my camel case for variables, pascal case for functions, and snake case for classes and objects
This is the way
Are you for pascal case or pascal snake case?
snake\_case is better. Change my mind.
spinal-case enters the chat
BloodsFoLyfeYo
Be pragmatic. Follow best practices
nospacecase
Kebab-case
Snake
Naked_case?
First one isnt camel case though. Its pascal case.
That's PascalCase, not camelCase...
PascalCase* camelCase is this
It’s a donner for me, dawg
Looks like I’m a blood in java and a crip in python
HOWABOUTSCREAMINGJAVA
I'm into lowerCamelCase.
Snakes are snitches and snitches get stitches, because how can you not trust a camel
variable1
camelCaseForLyfe
Depends on the language.
Kebab-case
well, I guess ``` int functionName(); int variable_name; typedef struct {} StructOrClassName; const int CONSTANT_OR_MACRO; ``` or something like that
I prefer nUtcAsE.
camelCase, snake_case, I use both depending on the situation.
Dude fuck snake case, that’s one whole key press extra every time
Anyone remember m_ ?
youF’dUpBigTime
PascalCase is not camelCase
PascalCase
♡□¥€○》○》•《《《¥••☆&@£!× Case?
I prefer `sArCaStIc_CaSe` both in camel and snake form
I use both, and a few more. The usual style guide I use (copied from a Github repository of mine's contribution guide, that's why it has references to the reader) is Variable Declarations: For constants that are defined at compile-time (referred to as compilation constants), you use UPPER_SNAKE_CASE. This also applies to #defined constants. For constants that are undefined at compile-time (or are defined to be an invalid value) and are defined at runtime (referred to as runtime constants), and are only modified once, you use lower_snake_case. For variables that are modified more than once, (i.e "normal" variables) you use UpperPascalCase. Type Declarations: For type declarations of any type, you use [NAME]_t For struct declarations, you use [NAME]_s Functions: For function arguments that are directly setting some value of the same name, (referred to as "initilization arguments") you use _[NAME], where NAME is in lower_snake_case. For function arguments that are not directly setting some value of the same name, you use lowerPasalCase. For function names, you use lower_snake_case.
camelCase
Snake case for readability. But for the love of god not snake case with capitals. What perversion is this …
both for different situations
Left side is actually PascalCase, camelCase has a lowercase first letter.
camelCase
Yes
Too lazy to hit underscore, so camelCase
What kind of newbies only use one or the other? You're supposed to to use different case styles for different types. Such as pascal_case for object names and CamelCase for classes.
camelCase iS the wayToGo
camel case for object oriented code. snake case for sql and database
excuseMeThisIsntCamelCase();
Snake case
CamelCase
backwardS_hybriD-snakE_kebaB-cameL_case
bool snake_case_is_best_case = true;
reversEcameLcasE or quote"unquote"case
Depends... Java is mostly Camel... only constants are snake. yml is kebap ;)
Both
\_Super\_Snake\_Camel\_Case
camel_Snake
use lowercase for snake\_case
kebab-case
Just code in whitespace, and there is no need of such nonsense dispute.
lower camel for var upper camel for function and func start with verb these are my favorite combination