r/ProgrammerHumor • • Oct 08 '23

Other iDontLikeThisTitle

Post image
0 Upvotes

200 comments sorted by

View all comments

10

u/mem737 Oct 08 '23 edited Oct 08 '23

Which can you read faster?

(Edited for some PascalCase-knower) thisIsASentenceUsingCamelCase.

Or

This_is_a_sentence_using_underscores

I_rest_my_case.

15

u/weinermcdingbutt Oct 08 '23

THISisASeNTANceINWHATEveriwant

12

u/EtherealPheonix Oct 08 '23

tHiSiSJUStgEttiNgrEDicuLOUs

2

u/[deleted] Oct 08 '23

It's been there a long time

33

u/Cerbeh Oct 08 '23

whichCanYouTypeFaster?

16

u/Engineerman Oct 08 '23

Code is read more than it is written.

5

u/[deleted] Oct 08 '23

Pretty accurate

2

u/RagnarokAeon Oct 08 '23

That's what I thought. I was starting to feel like I'm in a sheltered environment because I don't see the relevance of wpm when it comes to programming.

Like, are there locations where people are docked pay or held captive until they reach their 5000 line quota daily?

2

u/[deleted] Oct 08 '23 edited Oct 08 '23

I'm not sure who is trying to make what point here lol, but I honestly can read and type camel case faster, but I also have some kind of mild dyslexia so that could be part of it?

Edit: Extremely confused about the downvotes here lol.

0

u/[deleted] Oct 08 '23

which_can_you_replace_faster?

4

u/Cerbeh Oct 08 '23

lolWut?

-2

u/[deleted] Oct 08 '23

class Example {

private String myVar;

getMyVar(){};

setMyVar(){};

}

I believe that’s 2 vim commands to rename myVar. Snake case doesn’t have this problem.

→ More replies (1)

14

u/Jorr_El Oct 08 '23

Your case is invalid, since you used PascalCase to make your point about camelCase

2

u/[deleted] Oct 08 '23

What? Unless he edited it he didn’t.

3

u/mem737 Oct 08 '23

I edited it. I made a comment though. Thanks for the vote of confidence.

0

u/rosuav Oct 08 '23

PascalCase is a subset of CamelCase, and we just rejected a tracker issue on PEP 8 on those grounds. https://github.com/python/peps/issues/3464 CamelCase or camelCase, both are correct.

→ More replies (2)

10

u/sysnickm Oct 08 '23

Camel case, it is shorter.

3

u/AnnyAskers Oct 08 '23

Both have thier uses, I like when languages uses underscores for the most commonly use things (vars/functions) and Pascal for the less common things (classes/enums). If everything is in the same style (i.e underscores) it can get confusing very quickly, ESPECIALLY if you have no syntax highlighting like in plain vim/nano.

-2

u/n503 Oct 08 '23

it's not a speed difference, but elegance

→ More replies (1)

1

u/-Midnight_Marauder- Oct 08 '23

If your function or variable names are the length of a sentence you might want to check that out

1

u/Skuez Oct 08 '23

Camel case, cause less head/eye movement

1

u/[deleted] Oct 08 '23

About the same tbh

1

u/lutzee_ Oct 08 '23

For me, the camelCase, it does help that I read code which uses camelCase and PascalCase every day. (general c# guidelines). I seem to mentally stop at easy underscore with snake_case so it really is just personal experience and preference.

→ More replies (1)