Well here's the facts: There are plenty of high level IT workers who wear band shirts and sports jerseys with torn jeans to work and make six figures. And if you want to avoid people getting high, that is definitely NOT your field either, it's more of a question of if people are at least waiting until they get home to get high or are secretly doing it at work as well.
I'm not denying that there are people like this, but both my parents' careers are in this field and I've worked in it as well and that hasn't been my experience at all. There tends to be a large population of foreign-born workers at every office; while they dress casually for work, they are generally conservative in their lifestyle, and that sets the tone for the rest of the office. It might be different in more Internet- and consumer-oriented businesses, but in general Silicon Valley does not look like
Silicon Valley.