I was asked to take a contract project that I recognized as an UI component / app lots of businesses in that industry would need. I gave them a good price in exchange for me retaining the resell rights on the code. The contract was profitable, and afterwards I invested a few days time into creating a basic landing/sales page with an email address/contact form.<p>I then searched on Google for forum posts from other developers posting on programming QA sites & forums, trying to create the same UI component / app & having issues. I gave them advice about their code, and also shamelessly plugged my commercial UI component / app & suggested purchasing it as another solution to their problem.<p>Even if no one else purchased it, I was already paid to create it once. But it did work, I sold my UI component / app 1,000 times. I would sometimes make deals where I'd promise to add some new feature in exchange for them purchasing the app. Eventually I decided to open source it & move on to bigger projects.<p>So basically my advice is start with consulting, so you're getting paid for your time. Then if you happen to re-sell the code you wrote a second, third or 1,000x great... or if not, at least you were already paid once.<p>For example you found a client who wants a "todo app". Create a simple todo app & then try to find more clients who want the same thing, over time build it up to be the most sophisticated "todo app" on the market, with rules engines or all sorts of bells & whistles & customization built in. Eventually there will be no more market for hiring consultants to build "to do" apps, instead the de factor market solution is your app. I feel this is a solid strategy for creating a b2b startup company.<p>Lots of great programmers can create a CMS or a wordpress clone. But until you consult for some real companies with real world problems & understand where those systems fall short, you don't understand the market needs. Eventually you get tired of hacking on permissions/access control to some open source CMS as a consulting job, and you build your own CMS, or a plugin for that open source CMS & [re]sell that to your clients instead.