V
V
v- death2015-10-29 17:44:15
go
v- death, 2015-10-29 17:44:15

How to make this function not so scary?

func dataValid(result []string) bool {
  if v.IsLogin(result[0]) == true {
    if isLoginAvailable(result[0]) == true {
      if v.IsEmail(result[1]) == true {
        if isEmailAvailable(result[1]) == true {
          return v.IsPass(result[2])
        } else {
          return false
        }
      } else {
        return false
      }
    } else {
      return false
    }
  } else {
    return false
  }
}

Any tips for fixing this shitty code?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexxandr, 2015-10-29
@vGrabko99

rewrite in C :)
if (v.IsLogin(result[0]) && isLoginAvailable(result[0]) && v.IsEmail(result[1]) && isEmailAvailable(result[1])) {
return return v.IsPass( result[2]) }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question