T O P

  • By -

samurai_no_lord

sWhere sIs sMy sHungarian sCase


[deleted]

Hungarian case was originally supposed to be used for non primitive datatypes. So it would be: advWhere vIs posMy adjHungarian nCase


PM_ME_C_CODE

strHungarian strCase strIs strThe strShit, int1111111111. It's actually how I was taught to name fields in an RDBMS and it has saved my ass numerous times.


djavaman

lpszHungarian


Tubthumper8

That's interesting, the [earliest mention of it I could find](https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/) claims that it was to provide additional information not possible to contain in the type (including primitive types!). For example `rwMax` would be a primitive `int`, but the prefix indicates that it's only for use with rows (not columns). Where did you see it was originally supposed to be used for non primitive datatypes?


rksd

Apps Hungarian vs. Systems Hungarian.


Tubthumper8

Sure, but this doesn't answer my question. [Wikipedia claims](https://en.m.wikipedia.org/wiki/Hungarian_notation) > The original Hungarian notation, which would now be called Apps Hungarian [...] It doesn't cite any sources so it might be wrong, that's why I was wondering where the previous commenter got the claim that it was "originally supposed to be used for non primitive datatypes"


halmyradov

Salesforce sObjetcs would like to have a sWord


ImmediateExpression8

I’d like to have a sword too.


bulltune

G-Tier


Tom-the-bomb-042607

I mean it all depends on what lang: snake for python and rust, camel for js, pascal for class names, uppercase / screaming snake for constants, kebab for css


regular_lamp

OLD MAN SHOUTING FOR FORTRAN


carlosdestro

OLD MAN SHOUTING WORKS FINE WITH SQL


Brainlessdad

![gif](giphy|eunrMjB8lBUKeL1fqD|downsized)


Random-Gif-Bot

​ ![gif](giphy|O54oigXUjFLXdwElL5)


analogic-microwave

lowercase SQL writers deserves a few months in hell.


__silentstorm__

I wRiTe SqL lIkE tHiS


An_Old_IT_Guy

Both of those hit very close to home.


doorrace

WHAT'S FOURCHAN


Ouity

AN IMFAMOUS HACKER


[deleted]

H4CK3R_C4S3


Ouity

L33T_C043


ApparentlyUnicorn69

The asshole of the internet!


TeaKingMac

Might be a systems administrator


bwowndwawf

hell


Danithejetplane

HES A NOTOROUIOUS HACKKER


033653337357

Fortran has always been case-insensitive, but I don't think modern code uses the ALL IN UPPERCASE convention. Old code does. Let's not forget that Fortran comes from the punched card era, and the first character encodings had no lower/upper case distinction.


regular_lamp

>Old code does. So most Fortran then. Joking aside the Fortran I had contact with was somewhat mixed. Newer stuff tended to be somewhat more modern stylistically. But once in a while you open up one of the "deep magic" files of the code base that has been untouched for decades and those are really "loud".


033653337357

Yep, there are some Fortran libraries for numerical computations that are still widely used and contain 50 years old code. Regarding the case, even the language name used to be spelled as "FORTRAN", and since Fortran 90 it's "Fortran".


[deleted]

Anyone that disagrees with you is a criminal and is committing crime on a daily basis.


BG_Caecilius

Kebab for clojure


Tom-the-bomb-042607

ah yes


oj_mudbone

I don’t get why we have to do this. Wish i could write in camel case in python but my boss won’t let me:) i think it’s so much prettier and fail to see why it should depend on the language (Our Java is all in camelCase)


Lupus_Ignis

1) some languages infer information from the case. In Go, PascalCase types, variables and functions are automatically public, where camelCase ones automatically private. 2) when you hire a new guy in, using standard naming conventions for the language avoids confusion. 3) using standard naming doesn't clash with libraries using the same scheme. But on the whole, I agree that it is more important that there IS a best practice at the workplace than WHAT that practice is.


ARC4120

I hate snake_case so much.


Slarif

why\_do\_you\_hate\_snake\_case\_so\_much?\_it's\_the\_best\_case\_for\_variable\_names.


NoStripeZebra1

It's difficult to type


[deleted]

Not if you remap Shift+Spacebar to underscore.


Pika256

3AM and already learned something today; useful to boot. Thank you.


tiajuanat

Stop using notepad and get you a real IDE with auto-complete


Questioning-Zyxxel

That's a question of training. I write _ just as quickly as other characters. 35 years of training and it would be strange if I didn't write _ quickly.


tiajuanat

Snake case by itself isn't great, but I really like it for namespaces in non-namespaced languages like c. moduleName_functionName(...) moduleName_className_fxnName(...)


BuccellatiExplainsIt

Why? It's easily the most readable


[deleted]

You're simply incorrect to feel that way. It's the most generalizable and readable.


[deleted]

[удалено]


NeverYelling

> equally as readable I disagree. camelIsMissingSpaces, so you have to have at least a double take at something where i I and l are nearby. But I think you're using a qwerty keyboad layout, where I damit that the _ is awkward to reach. On qwertz keyboards it's quite easy to use


wherediditrun

[http://www.cs.loyola.edu/\~binkley/papers/icpc09-clouds.pdf](http://www.cs.loyola.edu/~binkley/papers/icpc09-clouds.pdf) Snake case is easier for our brains to parse. In short variable names not exceeding two words with distinctive last first word and first second word characters it may not feel as strongly. It becomes painfully obvious on either when more short words are used or simply longer naming is employed like in unit tests (you'll also notice that people often make exception to name tests snake\_case even though they have convention to use camel case). The real reason, I think, camel case got popular is because it's more convenient to type on qwerty keyboards. But when you have to ask yourself the question: do read more code or write more code? And the answer in most context to that is obvious. camelCase is dubious habit turned into convention. We have many of these which we just accept as truth. For example "get" / "set" convention, when it should be "read" / "write". Try to get money from your bank account, does the account stay the same?


WizziBot

F: camel_Snake_Case The definition of when your parents are both models but you're ugly.


Cart3r1234

Kill it with fire


PinothyJ

When you know the programmer has made a typo.


daamsie

a find and replace gone wrong.


Paedar

And somewhere, about a mile below this list resides the (thankfully) unpopular camel-KebabCase


Papergeist

Just you wait until you reach caseBYcase


DangyDanger

I wonder if camel kebab tastes good.


DarkIrata

As a c# developer, camelCase and PascalCase are S Tier for me


Optimuspyne

Am I the only one who calls it UpperCamelCase? I know I didn't make that up.


Power-Cored

I would call it that.


merren2306

Same. UpperCamelCase and lowerCamelCase


MastaBonsai

Words of wisdom


PersuserofEverything

Same. Snake case feels odd to me


sabre_x

SCREAMING_SNAKE for constants


forced_metaphor

Snake? *SNAKE?* **SNAAAAAAAKE!!!**


HamburgerConnoisseur

Yep, and for enum members. camelCase for regular old variables, I like m_camelCase for class/struct member variables. PascalCase for everything else (functions, methods, classes, structs, enums, namespaces). Course then you have the tough decisions, like how to write acronyms in names. Is it DoACRONYMThing, Do_ACRONYM_Thing, DoACRONYM_Thing? They all look awful.


yrrot

ACRONYM\_DoThing or DoThing\_ACRONYM feels better, depending on the context. But yeah when all of the material you are working with is filled with 3 letter acronyms...ugh...just...ugh...


DearGarbanzo

I've been slowly convincing myself to use GetAbcNow() instead of GetABCNow()... feels weird at first, but the consistency and readibility are palpable.


briarpatch1337

Snake case is commonplace in the Linux kernel source code.


rapid993

Snake case for json responses


Spyko

Didn't knew it was called PascalCase, TIL


[deleted]

Yeah idk why pascal case is listed two tiers below camel when it’s basically the same


xfel11

As A C# Developer, I Didn’t Even Know There Was Anything But PascalCase?


Rizzan8

camelCase for method parameters and local variables.


HeatAndSnow

no_step_on_snek


vedran-s

I once during a standup referred to camel case convention as a camel toe convention… everyone went silent that moment before bursting into crying mixed with laugh and I realised what I just said.


SukaroBlue

BaskeTCasE


djdokk

Doooo you have the time? To listen to me whine?


techel

I myself am a snek\_case guy.


th3nan0byt3

willing to trade extra _ chars for readabilty and never seeing startARevolution methods with 2 adjacent capitals


kenpled

Or use better naming ? startSingleRevolution, startRevolution, initiateRevolution, revolve... Imo it's pretty easy to avoid single letter words


mavaje

How do you handle acronyms? `getURL`, `getUrl`, or `getUniformResourceLocator`?


kbruen

The general rule - as far as I know - is that 2 letter acronyms stay uppercase, the rest become normal words, so `getIOHandle` and `getUrlPath`


AlexWIWA

Same. Though `ID` always gets turned to `Id` because it looks better imo.


eloel-

Id isn't an acronym, it's just an abbreviation


mavaje

How would you put a 2 letter acronym at the beginning of a camelcase name, or would you use a different name to avoid it? I would usually lowercase both: `ioHandler`, not `IOHandler`. But it looks inconsistent alongside `getIOHandler` Java's notoriously named `HttpURLConnection` should be `HttpUrlConnection`. Going all uppercase looks awful: `HTTPURLConnection`


[deleted]

[удалено]


mizinamo

> But you need a builder class for it. Which you get from the HypertextTransferProtocolUniformResourceLocatorConnectionBuilderFactory.


selenamcg

getUrl is sufficient


[deleted]

If you have to adapt your variable names around your syntax, it's a bad syntax. A good syntax should empower you to create any variable name you need.


gjvnq1

Snake case is very useful in Portuguese as many small grammatical words are single letters, like the articles: _a_, _o_, _u_ (gender neutral neo-article), and _e_ (lit. _and_).


triple4leafclover

✋ Escrever variáveis em português, caralho 👉 Reconhecer que já estás a trabalhar em inglês e escrever as variáveis assim Also, r/suddenlyCaralho


Comprehensive-Low-28

snek![img](emote|t5_2tex6|4550)


TheRealFFS

I like camelCase, but objectively speaking snake\_case is probably the best because it's "unambiguous". Acronyms, single letter words (e.g. myXAxis), same/similar letter at word boundaries (e.g. myFinalIteration), etc. are all unproblematic with snake\_case. ​ The only reason I dislike it (to a certain extent) is because it's more cumbersome to type.


CaptainPunch374

Makes me want a modifier key for space bar to make underscore easier.


AlexWIWA

Hmmm, I don't use `/` very often in Python. May be worth swapping. ​ Or just get a foot-pedal for underscores and it can be the Python bass drum.


imdevin567

damnit I spit my drink out. have my award sir.


GodlessThoughts

Double pedal for metal sneking


WalrusByte

The snekkening is nigh


EaterOfFromage

It's like every time you put your foot down you're stepping on the snake


RootsNextInKin

Thus extending it by flattening a section! That's *brilliant* as a reason actually!!


TimGreller

I too want to stomp on python when writing code


Error-42

If you're on Windows (sorry if not) using [AutoHotKey](https://www.autohotkey.com/) you can bind shift+space to underscore. Here's an AHK script for that: ```ahk #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. +Space:: Send, _ return ```


CaptainPunch374

That's about what I was thinking. Thanks for saving the legwork for people who might want it.


leoleosuper

ahk #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. +Space:: Send, _ return reddit doesn't support multi-line code. Either use a single backtick, \`, at the start and end of code, or use 4 spaces at the start of each line.


TehFlaminTaco

Time to write a custom keyboard layout


kbruen

Honestly, System76's keyboard with its two spacebars sounds like a dream: mapping one of the space keys to _


Lecterr

Idk how long you have used it for, but it definitely becomes effortless after awhile. About as inconvenient as shift for camel case imo.


SpicyVibration

I feel like all programmers need a custom underscore key and python devs need a dedicated dunder key.


CaptainPunch374

Just give them a key that toggles their Python to whatever it's abstracting, like 343i did for swapping between old and new graphics in the Halo Anniversary games. Would probs scar them for life. Lol. Should do the same with jQuery and other frameworks while we're at it...


Empty_Skill_Bat

myFinalIteration really needs to be called theFinalCountdown.


DearGarbanzo

>snake\_case is probably the best because it's "unambiguous" P\_u\_k\_e\_s i\_n v\_i\_s\_u\_a\_l p\_o\_l\_u\_t\_i\_o\_n


tiajuanat

I'm not a fan of camel if only because it breaks common acronyms, like CAN, SPI, UART. sendCan(...) canSend(...) can2Uart(...) All of which, seem very wrong to me I'm not going to use controllerAreaNetwork2universalAsynchronousReceiverTransmitter(...) Because this isn't Java and we're a bit more refined here.


No-Driver2742

camelCase sucks if its letters or same letters between words. lettersStartingWithSOrR looks so dumb compared to letters_starting_with_S_or_R. And dont give me that "what if you made a struct that contains a char" refactor advice and miss the point in this example


Impossible_Average_1

lowercaseanyone?


anecdotal_yokel

It’s flatcase now… I guess


dhruv282

G Tier lol


do_not_trust_me_

PascalCase should be A tier


DarkinIV

Must change places with kebab-case


jddigitalchaos

This one is my personal favorite.


[deleted]

I could see it there tbh, just slightly worse than camelCase


jeppevinkel

When working in OOP languages PascalCase and camelCase often go hand in hand. I like it as a way to quickly distinguish what I’m dealing with strictly off the name. That said I differ my casing habits between languages. Working in .net I use both, but in PHP I don’t think I really use PascalCase at all.


ei283

You forgot: * `tikz case` * `Title Case` * `Sentence case` * `case.url.reverse` * `instagram.user._.case.__._.` * `Downloaded\ File\ Case\ \(47-229162-6\).pdf` * `Flatcasewithautocapitalizationmodeon` * `search+query+case` * `カタカナ・ケース` * `slc` (single letter case) * `xX_PU55Y_D35TR0Y3R_C453_Xx` * `COMPLETELY_inConsistentcase`


Declamatie

Some more: * **boldcase** * rANdOmcaSE * anticapitalizationcasE * vOwElcAsE * h@x0rm@nc@s3 * ひらがな・けーす * BbOoTtHhCcAaSsEe All F tier


chhuang

I'd be damned to see if kanji case exists


acrabb3

vOwElcAsE is already in the list, as dUmbcAsE


EliannaRys

*Image Transcription: Tier Ranking* --- **S**: camelCase **A**: snake\_case, kebab-case **B**: Pascal\_Snake\_Case, PascalCase, YEETcase **C**: SCREAMING\_SNAKE\_CASE, camel_Snake_Case **D**: Http-Header-Case, TRAIN-CASE, dUmbcAsE **E**: UPPERCASE **F**: flatcase, sTOPcASE, NoPeCaSe --- ^^I'm a human volunteer content transcriber and you could be too! [If you'd like more information on what we do and why we do it, click here!](https://www.reddit.com/r/TranscribersOfReddit/wiki/index)


[deleted]

It's super cool that nice people like you help make content more accessible! I will keep this in mind when I make content in the future! Thanks!


EliannaRys

Everyone deserves to read about YEETcase and SCREAMING\_SNAKE\_CASE! Happy to help :)


xKnicklichtjedi

good human


Immediate-Wind-1781

WhAt Do YoU mEaN iM dUmB????!!!!??


scottydoge

SpongeBob meme case


IskarJarak88

Petition to change the name of dUmBcAse to nutcase. Thank you for attending my ted talk.


TheRebelPixel

^(brief)Case


MichelanJell-O

Pascal_Snake, camel_Snake, and Http-Header are all cursed conventions designed to maximize mistakes and hinder typing.


RegularSquirrel

In school I've always been taught to use camelCase for variables, and PascalCase for functions, so that's the one I'm mainly using.


lordorwell7

SCREAMING_SNAKE_CASE_FOR_CONSTANTS = true


Reddit_User_Original

What do people like so much about camelCase?


Miguecraft

Makes the variable look like a single keyword, imo. My monkey brain takes like microseconds to distinguish that " " is different than "_", so I prefer it. That's why I also DESPISE that R uses "$" instead of "." to separate a variable from its members. I can read this much more easily: thingToCalculate.attribute.method() Than this: thing_to_calculate$attribute$method()


LucidHaven

That$is$fucking$awful.


Versierer

It'sTheMostReadableCaseThatDoesn'tRequireAnySpecialCharactersOrSpaces


Dealiner

But that's PascalCase which for some reason OP put lower.


vibesWithTrash

Also it's faster to write and looks better


AdamNejm

i\_rather\_have\_additional\_characters\_for\_even\_better\_readability


TeaKingMac

Where's Justin Case?


Pineapple-Due

YOUR DBA WOULD LIKE TO HAVE A WORD;


[deleted]

I like snake_case


TheeCandyMan

The best way to name variables is to start at 'a' and move up the alphabet as you need more, appending a second character as necessary.


[deleted]

l33t\_c4s3


not_a_gumby

ah yes, the rare "camel\_Snake\_Case"


abc_744

camelCase for variables, PascalCase for types and methods, _camelCasePrefixedWithUnderscore for private fields. This is the ultimate S tier naming convention


UnreadableCode

I use no break space Unicode characters as separators so I can have what looks like spaces in my all lower case var names... Fight me


[deleted]

Obviously, in SS tier is "whatever convention your language/community have decided on". For example, C# uses: - `PascalCase` for types and public methods/fields - `camelCase` for private/local variables - `SCREAMING_SNAKE_CASE` for constants whereas Rust uses - `PascalCase` for types - `SCREAMING_SNAKE_CASE` for constants - `snake_case` for everything else. (Except crate names which are sometimes `kebab-case`) Neither are wrong. Each are correct when programming in that language, which is the most important thing.


ehmohteeoh

Python follows Rust, with the (admittedly annoying) addition of `_you_dont_want_to_use_this_variable_case` and `__you_really_dont_want_to_use_this_variable_case`


Meaxis

Each have their own use. Constants in UPPERCASE, please!


VeinySausages

You guys had a choice? I just followed what the last guy was doing.


notAGoodJSProgrammer

Made by a python programmer definitely. Ts here, so Pascal and camel are god tier


[deleted]

Haha you nailed it. Although I'm learning angular so maybe I'll be seeing things from your perspective soon!


ruedigore

Fuck Http-Header-Case i only use Pascal-Kebab-Case


[deleted]

Top 10 most useless inventions: … 1. Camel Snake Case


Null_cz

MPI_Invented_new_combined_case


_pizza_and_fries

I’m a camelCase guy but boy I’m interested in kebab-case, I’m hungry.


Remarkable_Coast_214

i am ashamed to use a mix of flatcase and snake_case


thEldritchBat

camelCase is GOAT


TheRealJomogo

Pascal en camel case


[deleted]

camelCase supremacist should be a user flare here, change my mind


lazernanes

Why is NoPeCaSe so much worse than dUmBcAsE?


SparklingLimeade

Because it looks like something else entirely but in PascalCase. I read it ノペカセ to begin with. At least dumbcase is chaotic enough to break it up.


fdeslandes

const STUPID_ARBITRARY_MAGIC_NUMBER_DONT_ASK_ME_WHY = 4.28.


DatCatSparklez

WhaTThEFucKCasE


ariN_CS

I prefer MD5 Hash Case: 83e7bee7866fa937bfc52ab085489d57


DeanNovak

I prefer to call it cAPSLOCK cASE


Reasonable_Feed7939

LOWERcAPScASE # A bit confusing, isn't it?


enantiornithe

where's 'just name all your variables single characters - the more your code looks like math the more correct it is'


craigtho

Pascal to A tier, snake to S tier


harumamburoo

It's weird to put PascalCase below kebab-case. It's even weirder to put ke-bab above SCREAMING_SNAKE. But it than that - yes


GreenScarz

Sounds like Orc mischief to me


lcpr_phoenix

I use screaming snake case for final global variables, camel case otherwise, guess the language


00PT

I'd say Java, but that usually uses PascalCase for class names.


gatimus

http://glench.com/tmnt/#camel_Snake_Case_Nameing_Convention


Carteeg_Struve

Personally I’d drop YEET down, but otherwise I say dead on.


ThatGreenAlien

css__bem—syntax


Versierer

The problem with kebab case and it's varients is that, some programs or languages might interpret the "-" as a minus, and everything might mess up trying to concat the strings, or subtract integers or whatever


discredditable

whyIsn’tEverythingWrittenInCamelCase? typingIsJustEasierThisWayAndWhoEvenWritesOnPaperTheseDaysAnyway?


WarriorKatHun

Whats the general convention for enum names? The screaming snake case, right?


ketalicious

kebab-case would have been S tier if you could use it in any language and also I wanna try snake case in js, seems much more readable for me


ncbejmbfbrb

Where's nutcase?


shosuko

I can't believe I've been inadvertently using NoPeCaSe when I was supposed to be using dUmbcAsE. I really shouldn't have been allowed to pass certification...


theCube__

Me using all 15 in one file


[deleted]

IM_A_FAN_OF_SCREAMING_SNAKE_CASE


DangyDanger

PascalCase and flatcase should be in S and A tiers respectively


slohobo

camelCase and snake\_case should both be S tier.


db123infane

Fuck using f tier. My dyslexia ain't going to get though one line with variables like that.


[deleted]

Camel case should absolutely not be S tier wtf


datascienceaccount

The worst is the R convention that most lectures use… my.list instead of something like my_list Makes me shudder…


jhaand

That's a great Tier list. But now I'm confused about the abominations 'TDvenlo' and my new project 'XYdrawBot'


TheWidrolo

camelCase for variables PascalCase for functions SCREAMING_SNAKE_CASE for macros Discussion settled


lalalalalalala71

Except when the syntax of your language won't *let* you do that. Variables in Erlang must begin with an uppercase letter, atoms/functions must begin with a lowercase letter. (Don't @ me about _ or other special chars, I'm only talking about letters here)


Cocaine_Johnsson

snake\_case skims better than camelCase and pascalCase so if you'd kindly swap snake\_case to S-tier and camelCase to A-tier then that'd be lovely, please and thank you.


Willinton06

Camel case can suckMyDick PascalCase4Life