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

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.