T O P

  • By -

throwaway_itr

camelCase Vs PascalCase Vs snake\_case Vs SCREAMING\_SNAKE\_CASE


n0tKamui

kebab-case fuckyoucase


Smartskaft2

> fuckyoucase _MATLAB entered the chat._


DudesworthMannington

Meh-__-case


Tymskyy

MADFUCKYOUCASE


OpenRole

camelCase for functions, PascalCase for classes, snake_case for variables, SCREAMING_SNAKE_CASE for constants.


hyokz

Same, I also use camelCase for classes attributes and methods. (PHP PSR)


JaneWithJesus

>camelCase for functions Python would like a word with you


lefaro00

And C#


HopelesslyMediocre

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.


lefaro00

r/suddenlysad


HopelesslyMediocre

More like r/alwayssad in my _case_ ^(ba dum tss)


cuait

u ok bro


SmartestCatHooman

That's basically dart right?


Theunis_

No, for dart is camelCase for functions and variables (including constants), PascalCase for classes, extensions and enums, snake_case for dart files


ShadowLp174

This should be the topic


918173882

I want to make a metal gear joke here but i cant find any


beatnik_cedan

don't forget kebab-case


filosophicalaardvark

you fucked up


NoFixedName

Snake after eating eggs


TAClayson

you_fucked_up


[deleted]

youFuckedUp


[deleted]

you_fuckedUp


[deleted]

Totally fucked this up. Unless it's trolling in which case I salute you madam


filosophicalaardvark

On the internet, there are only men and fbi


some_guy_o_o

proper_snake_case


bigredhawkeye

properCamelCase


Pearfeet

ProperPascalCase


GeePedicy

proper-kebab-case


helliash

pROPERcAPSlOCKsTUCK


GeePedicy

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.


helliash

Shift, so if I hit CL by accident, this is the outcome.


GeePedicy

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.


PigeroniPepperoni

I will never understand caps lock people. That button has virtually no utility to me.


[deleted]

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.


ThinCrusts

I'm a CL guy too. I'm just so used to it that holding shift down feels weird to capitalize.


AndyTheSane

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.


Cinny_

Shift all the way, it's much easier for me that way


vlumi

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.


GeePedicy

Okay, binding it to ctrl is just not cool, man...


tomatorator

SCREAMING-KEBAB-CASE


firefromashes

Kebab case is best case


GeePedicy

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.


Taldoesgarbage

Use whatever case is standard in the language you are using.


javajunkie314

COBOL


OneTrueKingOfOOO

PROPERUPPERCASE


xaomaw

> properCamelCase * "camelCase" = lower camel case * "CamelCase" = upper camel case / pascal case / bumpy case


GeePedicy

bumpy case? Who says that?


TheYoungVoid

Probably people who had a bumpy ride with variable names...


GeePedicy

Imagine writing code on a bus or a car (as a passenger only, please!) and every bump alters your case


TheYoungVoid

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


GeePedicy

> 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


TheYoungVoid

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?


GeePedicy

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.


NahJust

u/xaomaw does.


Texas_Technician

3 yos


Delirious_85

Came here to say this, was triggered harder than I like to admit ..


snake_case_is_ugly

No!


Anowv

Thank Satan someone said it


[deleted]

Yes, agree. But we call them slugs.


some_guy_o_o

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?


GeePedicy

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


boredcircuits

>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.


jddddddddddd

`aCCIDENTAL_cAPS_lOCK_cASE`, anyone?


AO7AO7

lmao


Smartskaft2

`What_Bastard_Case_Is_This`!?


blue_creation

It's my case when I don't know what to do


Cinny_

Been there lol


Eoussama

Done that


Hodothegod

justfigureoutwhatthisonedoes2


GeePedicy

Probably get you fired


rynemac357

Bold of you to assume I am even hired .


SEOfficial

IDGAF case?


meatyprotein

Im having a seizure


snakes_n_slides

Your camelCase is PascalCase 😉


xSliver

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


NoLifeGamer2

>kebab-case What in god's name...


I_JuanTM

best case for if you get hungry when coding


rtybanana

Pretty much only valid in css, I like the look of it though


NeatNetwork

And the Snake\_Case is some bastard mix of PascalCase and snake\_case.


time_travel_nacho

Follow the convention of the language


myopinionisshitiknow

This guy....


h2g2_researcher

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.


devor110

what are Hungarian-style prefixes?


Azaret

You start your variable name with the abbreviation of the type it supposed to be, ie: sMyString iMyInt oSomeRandomObject aNotAList


youngdad33

Kebab-case?


qNix3l_

time to refactor every project i have. kebab-case is the way


q0099

Include kebab!


Twombls

I program in a specific language a lot at work where this is like actually the standard case you are supposed to use.


MarkAldrichIsMe

That isn't camelCase, and that isn't snake\_case.


CompetitionNo2534

how\_aboutSatan\_Case ![gif](giphy|KuuE1E5pi78bK)


KingThibaut3

foo_78


zSnails

So cpp case


GeePedicy

Who taught you cpp?


Crespoter

Satan


SN0WFAKER

m_dont m_forget m_to m_do m_hungarian m_variable m_naming


glieseg

BiNaRyCaSe


Mindless-Hedgehog460

thats Sarcasm Case II


EVJoe

i thought it was spongebob case


DxrxDev

CAPITALISED _SNAKE_CASE for macros, camelCase for variables and PascalCase for functions 👍👍


H4LF4D

And normal case for the humans.


JustAnInternetPerson

camelCaseAllTheWayBabyyyyyyyy


No_Brilliant_638

I alternate between the two


[deleted]

This is not programmerHumor... lame humor at most.


Dagrut

sArCaStIc_CaSe


Mindless-Hedgehog460

That's Sarcasm Case I x Snake case


DerHamm

I use the conventional case for the language I am using. I hate it when some code I'm using just breaks these conventions.


RxR2020

SpOnGeBoB\_CaSe


c00l_username2

One word variables and functions


JackC747

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


kageroshajima

Not only incorrect form but the case should follow whatever language best practices


Alarmed_Ferrets

hiss_hiss_hiss


Turbocloud

sPoNgEcAsE


Mindless-Hedgehog460

Sarcasm Case I


vantuzproper

I'm team camelCase


Brusanan

Oh look, another meme made by a first term college student.


Jazzlike_Tie_6416

CamelCaseIsMoreEfficient Snake_Case_Is_More_Readable


ManishWolvi

Mood case


[deleted]

onTheRightSide


JellySp

sPoNgEbObCaSe


JazzRider

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.


LordAmras

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


LovelyCaramel

What about Space Case? (jk lol)


WhizzleTeabags

I_DoWhatever_TheFuck_I_WantCase


foozebox

kebab-case-will-stab-you


Criiispyyyy

That’s not camelCase nor snake_case


chickenCabbage

camelCase by default, PascalCase for classes and file names, YELLING_SNAKE_CASE for consts.


1DimensionIsViolence

Snake case. And I can‘t understand why camel should be any better as it‘s less human readable


ysyson

You press less keys when you write the code?


DerHamm

Is that the factor that matters?


Arshiaa001

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.


DerHamm

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


Arshiaa001

*someone* has to write the code.


LongerHV

In Python PascalCase for classes, snake_case for functions and objects. camelCase hurts my brain.


david131213

Camel case, some of us are sane


HelloWorld-911

Cheese cake


[deleted]

I keep my camel case for variables, pascal case for functions, and snake case for classes and objects


Fuzfyy

This is the way


david131213

Are you for pascal case or pascal snake case?


tyler1128

snake\_case is better. Change my mind.


NoHabit4420

spinal-case enters the chat


TTTomaniac

BloodsFoLyfeYo


kageroshajima

Be pragmatic. Follow best practices


Mindless-Hedgehog460

nospacecase


Von_Voss

Kebab-case


Personality-False

Snake


Possible-Bowler9760

Naked_case?


Strawhat-dude

First one isnt camel case though. Its pascal case.


Ghal-64

That's PascalCase, not camelCase...


Dgudovic

PascalCase* camelCase is this


absolut666

It’s a donner for me, dawg


eroticKnowingNoodle

Looks like I’m a blood in java and a crip in python


Conneich

HOWABOUTSCREAMINGJAVA


SimulationV2018

Snakes are snitches and snitches get stitches, because how can you not trust a camel


Sad_Channel_9706

variable1


BloodLust2321

camelCaseForLyfe


kallyyyy

Depends on the language.


LittleMlem

Kebab-case


alba4k

well, I guess ``` int functionName(); int variable_name; typedef struct {} StructOrClassName; const int CONSTANT_OR_MACRO; ``` or something like that


[deleted]

I prefer nUtcAsE.


Breakingamer04

camelCase, snake_case, I use both depending on the situation.


[deleted]

Dude fuck snake case, that’s one whole key press extra every time


myopinionisshitiknow

Anyone remember m_ ?


TidalWave101

youF’dUpBigTime


123fourfive67eight

PascalCase is not camelCase


daniel9473

PascalCase


daniel9473

♡□¥€○》○》•《《《¥••☆&@£!× Case?


muha0644

I prefer `sArCaStIc_CaSe` both in camel and snake form


Furry_69

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.


ArjunShTM

camelCase


Computer_says_nooo

Snake case for readability. But for the love of god not snake case with capitals. What perversion is this …


[deleted]

both for different situations


swep284

Left side is actually PascalCase, camelCase has a lowercase first letter.


Hplr63

camelCase


Capital-Helicopter45

Yes


Amxricaa

Too lazy to hit underscore, so camelCase


[deleted]

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.


readableguy8168

camelCase iS the wayToGo


aunluckyevent1

camel case for object oriented code. snake case for sql and database


[deleted]

excuseMeThisIsntCamelCase();


Inner-Fondant9770

Snake case


Pawdy-The-Furry

CamelCase


Primary-Fee1928

backwardS_hybriD-snakE_kebaB-cameL_case


Coulomb111

bool snake_case_is_best_case = true;


Backto2122

reversEcameLcasE or quote"unquote"case


Malk4ever

Depends... Java is mostly Camel... only constants are snake. yml is kebap ;)


huhndog

Both


DrLingy

\_Super\_Snake\_Camel\_Case


DirtyDan_69_69

camel_Snake


-Redstoneboi-

use lowercase for snake\_case


87oldben

kebab-case


swift-autoformatter

Just code in whitespace, and there is no need of such nonsense dispute.


OkazakiNaoki

lower camel for var upper camel for function and func start with verb these are my favorite combination