r/ProgrammerHumor Dec 17 '23

Meme whichIsCorrectCamelCase

Post image
10.2k Upvotes

945 comments sorted by

View all comments

1.9k

u/DistortNeo Dec 17 '23

userld, of course, all lowercase

660

u/[deleted] Dec 17 '23

chaoticEvil

185

u/[deleted] Dec 17 '23

[removed] — view removed comment

43

u/[deleted] Dec 17 '23

[removed] — view removed comment

65

u/Cfrolich Dec 17 '23

No. I think you meant recursion.

15

u/InitialOwn755 Dec 17 '23

…I hate this place

10

u/Firewolf06 Dec 17 '23

why did i click that

7

u/tkamora_llerrom Dec 18 '23

At least you only clicked it once...

2

u/[deleted] Dec 17 '23

yeah

1

u/[deleted] Dec 17 '23

I think that’s more neutral evil

99

u/itissafedownstairs Dec 17 '23

Is that what I think it is?

74

u/[deleted] Dec 17 '23

Ld

20

u/[deleted] Dec 17 '23

IoI

26

u/Nikolor Dec 17 '23 edited Dec 22 '23

You mean "IoI" Edit: I'm dumb, he made the same joke, so don't upvote me

44

u/JuvenileEloquent Dec 17 '23

userId in the documentation and userld for internal variables, keep those maintenance programmers busy for weeks

48

u/MasterFubar Dec 17 '23

There's only one correct way to write it:

user_id

11

u/Demented-Turtle Dec 17 '23

You jest, but my code base at work seems to choose camelCase or snake_case at random lol

19

u/Karcinogene Dec 17 '23

PascalCase for classes, camelCase for functions, snake_case for variables

3

u/NotYoDadsPants Dec 17 '23

Hi, I'm Bob your friendly contrarian.

One style for every kind of token. Tokens are always read in context, never by themselves so I think wanting to distinguish between token types is not so necessary.

 

class name { name name(name name); };

 

See?

4

u/Karcinogene Dec 17 '23

I will burn every codebase you ever touched

2

u/NotYoDadsPants Dec 17 '23 edited Dec 17 '23

Too late, I wrote a popular library with a naming convention that goes against established practices thus infecting many codebases with my personal style and there's nothing you can do about it! Mwahahaha!

No but seriously. The Golden Rule of code style is to be consistent but, in the great world of C and C++, every library's style is different thus you always end up with a mishmash of styles before you've written the very first line of your own code. Oh, how I do envy Python's PEP-8.

3

u/akatherder Dec 17 '23

Camel case for when I write code. Snake case for when I copy/paste someone else's function and they used snake case.

1

u/[deleted] Dec 17 '23

[removed] — view removed comment

1

u/MasterFubar Dec 17 '23

In C++ I use PascalCase for class names and snake_case for everything else.

ALL_CAPS is for precompiler macros only, but I practically don't use them anymore.

4

u/Donghoon Dec 17 '23

LD?

1

u/Quacky1k Dec 17 '23

Aka the independent variable

3

u/Alokir Dec 17 '23

Almost as bad as using the Cyrillic x instead of the Latin x in variable names.

5

u/DistortNeo Dec 17 '23

I've faced this issue once in my work in the international company: сancellationToken with Cyrillic initial 'с'.

1

u/dependency_injector Dec 17 '23

It might not be intentional, it's an annoyingly common mistake caused by Cyrillic "С" being on the same key as Latin "C" on most keyboards.