More options:
- Go solo. At 40 you should be experienced enough to handle up to mid-sized projects, alone and on a reasonable time-frame. Try to pick projects that your clients will actually use, with new features and support contracts you will have steady income for the long-term.
- Go startup. Stop thinking you need to come up with the next über-for-x. There are plenty of opportunities for small sass shops that cater locally and provide sufficient income for a micro successful business. At worst you'll be acquired.
- Go sidetrack. I read someone said every business is a software business. Start a different career/business and you'll be doing the IT needs yourself. That alone is a huge competitive advantage.
These options allow you to continue programming after 40 and you should! It is an urban myth that past 35 programmers are not as good b/c they get tired faster or make more mistakes? The truth is that 20-somethings can put up with very long hours b/c they have the time (mainly due to not having a wife and kids) while 40-somethings have the experience to go right to the answer. That's productive vs efficient. I like to use a soccer analogy: a young defender is good when he's fast because he can outrun the attacker, while an old and slow defender is better because he knows where to stand and wait for the attacker. Experience is gold.
These options allow you to continue programming after 40 and you should! It is an urban myth that past 35 programmers are not as good b/c they get tired faster or make more mistakes? The truth is that 20-somethings can put up with very long hours b/c they have the time (mainly due to not having a wife and kids) while 40-somethings have the experience to go right to the answer. That's productive vs efficient. I like to use a soccer analogy: a young defender is good when he's fast because he can outrun the attacker, while an old and slow defender is better because he knows where to stand and wait for the attacker. Experience is gold.