Relationships with programers has always been dodgy. Most programmers are not business, marketing or entrepreneurial people. Chances are they not as passionate about your vision as you are.
Unless you employ them full time, set clear goals and schedules for them to follow, I'm afraid you'll be let down every time.
Getting a lawyer involved to draft a good solid contract is the first step as an employer with any employee.
If you're using a freelancer/contactor to programme for you, the same applies, -a solid legal document so both parties are on the same page to start. A mutual non-disclosure agreement (confidentiality agreement) should be part of that contract, so that the programmer doesn't steal your idea (Think of the Facebook founders saga).
Thereafter, once the contracts are signed, sit with the programmer and work out a realistic schedule with clear goals and deadlines.
Make sure there are penalties built into the contract that hold the programmer accountable for missed deadlines.
Break the project down into what needs to be done immediately, halfway down the road, at the end of the project and thereafter.
The more you break the project down into manageable pieces, with checks at each stage, the better you'll be able to manage the project.
Payments only happen after each piece is approved, tested and is working properly, also consider if something 'breaks' after it's been built -will the programmer fix it? -make sure it's in your contract.
Basic project management principals apply throughout the project.
If the programmer you want to work with, isn't willing to go this route, chances are they're either not confident enough to build what your looking for, or they're the typical, fly-by-night, get-wht-they-can-and-run types.
Good luck with finding someone like that. I've realised after a good few years, that you'd be better off working with a company that offers those services, than an individual. Either way being covered legally and being super clear on what you want and how you want it is essential.
I hope this helps