Skip to content

Instantly share code, notes, and snippets.

@andersr
Last active November 15, 2021 23:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersr/10471560 to your computer and use it in GitHub Desktop.
Save andersr/10471560 to your computer and use it in GitHub Desktop.
Pseudocode Example: A Signup Form

#Pseudocode Example: A Signup Form ##Entities

  • Email field: input type = email, placeholder: “your@email.com
  • Password field: input type = password, placeholder: “Password”
  • Password confirmation field: input type = password, placeholder: “Password again”
  • Signup submit: value: “Sign Up”, default state, disabled

##Signup Flow/Logic

###On leave focus of email field

IF email is blank

    Error message: “Please enter an email address.”

ELSE IF email field value is not a valid email address

    Error message: “This doesn’t look like an email address. Please try again.”

###On leave focus of password

IF password is not sufficiently strong

    Error message: “Please replace with a stronger password.”

###On leave focus of password confirmation

IF password confirmation does not match password

    Error message: “Please replace with a stronger password.”

###On leave focus of email, password or password confirmation

IF email AND password AND password confirmation all contain valid values

    Enable Signup Submit

##Discussion topics:

  • What constitutes a sufficiently strong password?

  • What constitutes a valid email? Eg do we want to allow “bobjones+alias@domain.com

  • What should we do if the email already is in use?

    eg ELSE IF email field already is in use

      Error message: “This email is already in use. Did you want to [Sign In] instead?”
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment