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
-
@ReturnVoid unless it is for educational purposes. You wouldn't get away with naming vars x and y in a company.
-
@JavaRules I used to think like you, but...
Leaving aside the possibility that x and y correspond to coordinates on a Cartesian plane, another good reason to use generic names is when you want a generic function. If you look at a number of standard library calls in any language you'll see that the parameter names often give no clue as to their context. For example, in C you have
int strcmp(const char *str1, const char *str2)
Java libraries are the same way, when you get down to basic, generic functions you'll see that more descriptive names would imply logic counter to the function's generic intent -
Also, return is not a function, worry even more about the guy who skips the parenthesis. (in C and C++, I don't know what your screenshot shows)
Ah, and the totally useless comment is totally useless. -
@ReturnVoid Actually, the point of having it in a function is to hide the logic from the caller, abstraction for the reader, and easier maintenance if the condition changes in the future.
Related Rants
DevZoned!
undefined
crush
programming