Another similar idea: a space $X$ is connected iff it has no non-constant continuous functions from $X$ to ${0,1}$ {0,1} in the discrete topology.
Another similar idea: a space $X$ is connected iff it has no non-constant continuous functions from $X$ to ${0,1}$ in the discrete topology.