In any business to business contract, don't be afraid to negotiate aggressive payment terms. I learned that the hard way with my first client being net-15. The higher the payment takes the settle, the more trade credit you are offering your client, increasing their PAYDEX score while messing with your cash flow. Ask for at least half up front.
This kind of safe advice isn't very helpful for someone who is hustling IMO. Maybe it is useful for someone who's going to become a principal engineer at a large corporate. The parent commenter would be well suited to work at a startup. Unfortunately, startups have also been infected by the corporate virus. In a country that's stagnating, such risk averse behavior makes sense, because there is no reward for taking on risks.