wanadecrypt icon indicating copy to clipboard operation
wanadecrypt copied to clipboard

Multiple if pyramids

Open deltabeard opened this issue 7 years ago • 2 comments

There are multiple if pyramids in your code, such as line 75. Use your if statements to check if the statement is false rather than true. That way you won't need to wrap all your program logic in ifs.

Edit: It looks like pr https://github.com/gentilkiwi/wanadecrypt/pull/1 fixes this.

deltabeard avatar May 16 '17 10:05 deltabeard

I was going exactly to fix that, fortunately i checked the issue before starting.

Your fix could be further enhanced by separating logic and wprints. (introducing internal return states and handling them separately. in this case displaying a message to the user.)

maurosampietro avatar May 22 '17 07:05 maurosampietro

I didn't make the pull request. You should comment your suggested changes on the pull request.

deltabeard avatar May 22 '17 07:05 deltabeard