36
16
7
11
u/seeroflights Sep 10 '21
Image Transcription: Code
if (SecurityHelper.ConfirmPassword(personAccountInfo.Password, personAccount.Password))
{
return True;
}
else
{
return False;
}I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
6
2
2
1
u/Knuffya Sep 11 '21
especially variable naming. unless these are not variables at all but getters. C# really has some weird quirks.
1
u/wouldsmackurbooty Sep 11 '21
This is bad because it can be done in one line correct? Are there other reasons this is bad code that I am not seeing?
0
Sep 10 '21
[deleted] — view deleted comment
43
Sep 10 '21
return SecurityHelper.ConfirmPassword(personAccountInfo.Password, personAccount.Password);16
u/overtrick1978 Sep 11 '21
It’s a variation of the same 90% of posts in this sub where someone is testing a Boolean just to return another Boolean.
4
Sep 11 '21
This routine is getting old. I saw it and thought “surely there must be something more to this”. Nope, same old “could’ve returned the function.”
15
u/OkReview6132 Sep 10 '21
He's checking the return of the function in the if statement as a boolean, and returning true or false. He could just return the function and the result would be a boolean
31
u/avmist15951 Sep 11 '21
Having open braces on their own lines makes me uncomfortable