I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
It might be just me, but once I've got a variable name that implies it's a boolean, I want it to be a boolean. If isValid was some kind of object, for example, then it's going to be really confusing to see it in a debugging message later on, and I'm going to wonder what I broke.
In C#, you'd probably have a property like .Result or .IsValid, and although Result is ambiguous, I see it often enough, especially with async methods. To make it less ambiguous, validate() would be CheckIfObjIsValid(myObj).Result, but that's a debate about naming conventions (and part of why I made this post).
Someone might read this and wonder why you split hairs over something seemingly trivial. But focus on these tiny decisions is critical. Even if they are subjective, they reflect someone thinking
This isn't good enough
This is good enough
That was good enough, but this is better.
and all for reasons that they've thought through. It costs seconds and pays minutes. It pays hours when it prevents introducing a bug or more complicated code or when someone else follows the good example. Code is made entirely of details. Code matters, therefore details matter.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It might be just me, but once I've got a variable name that implies it's a boolean, I want it to be a boolean. If isValid was some kind of object, for example, then it's going to be really confusing to see it in a debugging message later on, and I'm going to wonder what I broke.
In C#, you'd probably have a property like
.Result
or.IsValid
, and althoughResult
is ambiguous, I see it often enough, especially with async methods. To make it less ambiguous,validate()
would beCheckIfObjIsValid(myObj).Result
, but that's a debate about naming conventions (and part of why I made this post).Someone might read this and wonder why you split hairs over something seemingly trivial. But focus on these tiny decisions is critical. Even if they are subjective, they reflect someone thinking
and all for reasons that they've thought through. It costs seconds and pays minutes. It pays hours when it prevents introducing a bug or more complicated code or when someone else follows the good example. Code is made entirely of details. Code matters, therefore details matter.