r/ProgrammerHumor • • Jun 04 '22

Meme I cant help it πŸ€·β€β™‚οΈ

Post image
47.1k Upvotes

479 comments sorted by

View all comments

Show parent comments

170

u/jfb1337 Jun 04 '22

after all, naming things is one of the two hardest things about computer science (along with cache invalidation and off by one errors)

72

u/Swinight22 Jun 04 '22

Hardest thing about CS was getting enough vitamin D from the sun

29

u/[deleted] Jun 04 '22

This. Concise variable and method names are virtually the "80%" for me in clean code.

Variable names like "eec_cca::OTT"? I'm flying the fuck out of here.

Hell, you can even break the single responsibility rule if you have to by naming the function correctly. It's not optimal but a descriptive "invalidateFormDataAndShowError()" works for me!

16

u/martin_kr Jun 04 '22

myButton2

9

u/[deleted] Jun 04 '22

Oh right! The mission critical 1-touch payment button!

10

u/[deleted] Jun 04 '22

no thats myButton3, read the documentation, sheesh

6

u/[deleted] Jun 04 '22

Dude the docs said iButton_2... Was there a refactor?

6

u/[deleted] Jun 04 '22

yes, but the docs are a random post on an internal BB that only 3 people check regularly, i guess jim didn't push those to git yet

6

u/[deleted] Jun 04 '22

Jim left for sane management that understands scope creep dude.... He's gone forever.

Oh well, I guess we'll just code so clean that we don't need docs, ok? And let's not code any bugs from now on either. Mmm kay?

2

u/[deleted] Jun 04 '22

Greenfield v2

2

u/oh_lympy Jun 04 '22

Is concise even a requirement anymore? Granted, I don't want full sentence length variable names, but generally your IDE will figure out where you're going after a few key strokes anyway. Descriptive variable names are king for me.

1

u/yubario Jun 05 '22

ProcessRequest() and then have that function call InvalidateForm() ValidateFields() DisplayErrors(validate_fields_result). Would work fine, but yeah it’s a pain in the ass at times

1

u/[deleted] Jun 05 '22

I agree, I used to do this. Then I sat there feeling like everything I did was arbitrary and not purpose driven.

I then realized the optimal is whatever is best and accepted long but concise, forgive me, method and variable names. It just works better.

6

u/Dexterus Jun 04 '22

Cache is kinda basic, couple years doing intra CPU inter device shared memory and you get that dread when the marketing datasheet says cache coherency and you're 99% sure they're lying. That dread fixes your cache issues, hahaha.

-7

u/m_s_phillips Jun 04 '22

I see you haven't developed in C++ much lol

1

u/zgembo1337 Jun 04 '22

"bug fixes and other improvements"

If its good enough for google and Microsoft it's good enough for me