Zuckerberg discusses writing the first code for Facebook, and says his experience writing games and a music player for himself while young helped.
If you want to be able to connect with the people around you you have to start building software that other people want to use as well.
At Harvard, he wrote a scraper to extract information from the course cataloge and ran the site from a laptop in the dorm room. He says he met Chan at a going away party after Harvard threatened to kick him out. People involved in Facebook focused on developing it for fellow students, and talked about how someone else like Microsoft would likely build the service for everyone to use:
We thought, we’re just college students, what do we know about building software that hundreds of millions of people are going to use?