Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
isawen1207yFor me yes. He is right. You spend more time reading the code than writing it.. so it should be very clear.
-
Yes its called consistent code.
Fn could mean tons of things. Now its clear, but what when the code is a year old, and someone has made fn a abbreviation for something unrelated. It will be a PITA to understand it.
I came across a certain class called ScMsg. message is clear but Sc wasnt for me. Okay lets read the description in the comment
"// the sc msg class", hmm that didnt help lets see the class itself then.
Everywhere it says sc msg, no clue what it means from the class itself.
Lets look at the usages.
Hmm its only used in a file and only in combination with the variable ScMsgQ...
After an hour of research and asking teammates nobody knows what it means... -
The more code is one whole consistent thing the easier it is to read and understand it.
No unnecessary else's are a great example of that -
I would say your function should not have multiple exit points. But that’s all coding style, so there isn’t „the“ answer...
-
psukys2327yDo you really need hungarian notation? Have you considered that naming the function what it actually does resolves the need to insert the type into the name?
-
Xo-oY306yHmm, I'm just wondering if Func is actually clearer than Fn, since Fn is used quite widely in computer to short for function, like on the keyboards, or jest.fn()
-
Xo-oY306yWould you say if (type==='json'){return response.Jason();} return response.text(); is more clear than if (type==='json'){return response.Jason();} else {return response.text();}? And it MUST BE changed to fit the first type? FYI the lead does not have this rule written anywhere, it's just something she does in "most projects"
Is it normal that my lead developer insists that if(x){return A} else {return B} must be changed to if (x){return A} return B, and a variable must be renamed from requestFn to requestFunc because the former is confusing?
question