Adjust control structure in CharmBoard::Controller::Auth #1

Closed
opened 2023-05-07 15:13:20 +00:00 by nu · 2 comments
Owner

The control structure here sucks. It sucked to write, it sucks to read, and I guarantee that if left alone, it'll suck to make minor changes to later on.

I had it suggested to me to try maybe switch statements, and I also saw that suggested elsewhere as a way to improve upon nested if/else control structure. I'll need to look into that and some other things more though as I'm not super familiar with the options here atm

The control structure here sucks. It sucked to write, it sucks to read, and I guarantee that if left alone, it'll suck to make minor changes to later on. I had it suggested to me to try maybe [switch statements](https://perldoc.perl.org/perlsyn#Switch-Statements), and I also saw that suggested elsewhere as a way to improve upon nested if/else control structure. I'll need to look into that and some other things more though as I'm not super familiar with the options here atm
nu added the
improvement
label 2023-05-07 15:13:20 +00:00
nu added the
code clarity
label 2023-05-07 15:14:59 +00:00
Author
Owner

And now with commit 07977292fe I've fixed this specifically for login_do, but I used a try/catch control structure instead of given/when. Still unsure what I should be doing for register_do however, because it's complex enough that I don't think I can do one big try/catch

And now with commit 07977292fe I've fixed this specifically for `login_do`, but I used a try/catch control structure instead of given/when. Still unsure what I should be doing for `register_do` however, because it's complex enough that I don't think I can do one big try/catch
Author
Owner

As of commit f0ab7713cc, both login_do and register_do use two try/catch blocks each, making this problem solved!

As of commit f0ab7713cc, both `login_do` and `register_do` use two try/catch blocks each, making this problem solved!
nu closed this issue 2023-05-08 10:33:37 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nu/CharmBoard#1
No description provided.