Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "snake_case"
-
Cringed when I saw camelCase, snake_case, PascalCase and CONSTS (for non consts) in 10 consecutive lines of code! 😖😖😖
I suppose if you don't know which coding style to pick... Just try them all!!!!! 😱7 -
Tabs v Spaces...
camelCase v snake_case
'single' vs "double"
hyphen-vs_undescore
The point here is PICK ONE AND USE IT.9 -
/badhumor
Make a song title or text geeky/dev related, e.g.:
JSON Derulo - Talk Nerdy To Me
Katy Proggy - Firewall
DJ KhaLED - All I Do Is Print
DJ snake_case - Git Push For What
Now you!4 -
People who mix different naming conventions are the worst. My MATLAB teacher mixes PascalCase, camelCase, snake_case and weird hybrids like everythingIs_SoWrongWith_this 😠1
-
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.10
-
Writing in cammelCase [or snake_case] means I have to press SHIFT quite frequently. Aaaaand now I have a sore pinky from pressing that right Shift all the time.
I've heard of the carpal tunnel syndrome.
Also heard of the student's elbow syndrome.
Is Shifting Pinky syndrome something we, developers, should call a thing? :)12 -
so some controversial opinions
Our company is moving most of our code style to snake_case, even the JavaScript. Here's our resoning:
Take the CustomerAccountMembership model. In our Python server, we would access it as obj.customer_account_membership, in JavaScript as obj.customerAccountMembership and our API endpoint as api/path/customer-account-membership. Thus we had several String utility functions such as `camelize`, `kebabChop` (which is ironically camelCased) and `snakeify`, and we would use them in translating from URL path to JS to Python, which was troublesome.
Now HTTP allows _underscores_ unescaped and do not pose any significant meaning. JavaScript also accepts it as a valid character in variable names. On the other hand, HTTP is strictly lower-cased, and all computer languages use the -dash- to signify subtraction. Sooo the _underscore_ is the only style that is compliant everywhere.
Unless, of course, we go with customeraccountmembership, which I refuse to do.
I'm not that deep into code character rules.
Opinions?7 -
Doing someone else's Code Review in my project: "You must retain the holiness and piety of the code you write by following PascalCase naming for files and kebab-case naming for CSS variables. Avoid using duplicate strings by declaring enums in a constants.ts file and using that all throughout the app"
During my own Code Review in someone else's project: "WHAT THE FUCK DO YOU MEAN I CANNOT PASS FUNCTION REFERENCES AS PROPS TO A REACT COMPONENT AND ALWAYS NEED TO INVOKE IT INSIDE AN INLINE FUNCTION FOR THE PROP."
"WHAT KINDA FKIN DRUGS ARE YOU ON TO USE snake_case IN TYPESCRIPT DID YOUR MOM DROP YOU ON YOUR HEAD WHEN YOU WERE BORN YOU SACRILEGIOUS PIECE OF SHIT"
"WHAT DO YOU MEAN I SHOULD USE BOTH SINGLE AND DOUBLE QUOTES FOR IMPORTS AS PER LOCAL OR GLOBAL; I'LL SHOVE THE SINGLE QUOTE UP YOU WHERE THE SUN DOESN'T SHINE YOU FKIN DEGENERATE MORON"
As much as I do believe in self righteousness of my own coding conventions over others (I might be slightly better than others but I really can't claim good authority because I've had my lapses in conventions too; and being one of the newer members of the team certainly doesn't help, despite my boss supporting my initiative), I guess it is high time we bring in some already established code conventions in the team that is finally big enough to warrant them. Maybe AirBnB. -
When people try to tell me that spaces are better than tabs and that PascalCase is better than snake_case :-39
-
After the instruction given by project manager to use snake_case names for CSS classes, now he tells everyone his contribution in project. -_-
-
Seriously, what's with the naming ordeal?
We start with userInput, then spiral into userInputUpdatedFinalV2
Are we writing code or crafting spell incantations? camelCase, snake_case, kebab-case, PascalCase – it's a syntax battleground.
Can we have names that make sense, for sanity's sake?3 -
Imagine that I have written 1000 lines of code and imported many libraries. Sometimes I get confused when trying to use a name I defined earlier. In my mind is this name a class or a method, is it a local or global variable, is this a constant. So I came up with a way and it totally works, although my ide complains, but who cares, I use it anyway.
I use PascalCase for class.
camelCase for methods.
snake_case or lowercase for global variables.
kebab-case I don't use this
UPPER_CASE for constants
snake_caseL or lowercaseL with a capital letter L at the ending for local variable.
I hope this is helpful 😊🤔11 -
Am I the only person pissed off with PHP PSR-2? Maybe I like coding with snake_case instead of camelCase. I don't care what other devs use so why do I have a gang of controlling ass-hats telling me how to write my own code!?! >:(4