In that case you are criminalizing something other than the thing you actually want to stop. It's not walking across the street that's the problem, it's running into traffic. In this relatively low stakes problem people still run into the problem of not knowing the unwritten law. For instance people from cities where jaywalking is never prosecuted go to somewhere where it is aggressively prosecuted and get shafted.