Trouble maker and Problem solver ⚙️🔧
Loves simplicity, hates bullshit 💩.
Productivity obsessed, avid learner 🖥🚀
Sport and outdoor freak 🧗⛰
Metalhead 🎸🤘 Father of 2 👨👩👦👦
Opinions are my own
absoulutely agree. i understand the need for the convention, since ( expecially at the beginning of your career) you are able to immediatly find or recogninze a boolean variable by the fact that starts with is or has, but was never bought into this.
exactly for the reason you mentioned,
is it a question? are you asking me? i don't know, you should tell me!
and because of the many exceptions that make some variables seriously grammatically terrible. I found this post because I was looking for alternatives or way of telling in a Pullrequest that isUserAlreadyExist is a complete NOPE for me...
imho, dimply use conventions when it makes sense, ( possiblly in thex affermative format - like useIsActive - which in my case would become a more natural userAlreadyExists)
Then I already know the answer and can store it in a variable like userExists or saved. Don't need to ask once again. If I want to ask, I would use IsSaved() or IsExistingUser().
I especially love the pattern with some auto-generated codebase for based on OpenAPI or protobuf specs - the accessors Get prefix irritates me even more. getIsActive() function always sounds to me as if by invoking this function I will get another function as a result, which will tell me if a user is active if I invoke it.
absoulutely agree. i understand the need for the convention, since ( expecially at the beginning of your career) you are able to immediatly find or recogninze a boolean variable by the fact that starts with is or has, but was never bought into this.
exactly for the reason you mentioned,
and because of the many exceptions that make some variables seriously grammatically terrible. I found this post because I was looking for alternatives or way of telling in a Pullrequest that isUserAlreadyExist is a complete NOPE for me...
imho, dimply use conventions when it makes sense, ( possiblly in thex affermative format - like useIsActive - which in my case would become a more natural userAlreadyExists)
What about the point that no code ask you but you have asked the data about something and store answer in variable with the same name?
Then I already know the answer and can store it in a variable like
userExistsorsaved. Don't need to ask once again. If I want to ask, I would useIsSaved()orIsExistingUser().I especially love the pattern with some auto-generated codebase for based on OpenAPI or protobuf specs - the accessors
Getprefix irritates me even more.getIsActive()function always sounds to me as if by invoking this function I will get another function as a result, which will tell me if a user is active if I invoke it.isExistingUser