In my case it's not always practical - I like to come home for lunch, see the kids, have lunch with my wife.
There are plenty of tech companies here within walking distance, lots of job options and an OK startup scene.
Also, don't have a car. I use Zipcar or taxis when necessary (maybe 10 times a year). Not having to pay for a car, insurance and parking saves a lot of money. That savings makes living in more expensive city apartments more easy to afford.
Not having to drive to work is my number one job perk, and living in a city is much more enjoyable (to me at least) than not.