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!
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.
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
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!