Sure, but what if the check gets more complicated? Like, if instead of storing the plain password you store a hash of it, so the check is for the hash instead of just a ==.