There seems to be an assumption that people are generally lazy and need to be persuaded to action by an outside force such as money, or more abstractly, the threat of destitution. However, I reject this from experience.
What compels me to code is not an external drive, but an internal desire to solve interesting problems. Yes, I want to make money from what I do and ultimately I want my code to help people, but what makes it interesting for me is that it is challenging, like solving a puzzle.
I first learned to code through video games which allowed significant configuration through their editors, and spreadsheets which become so much more powerful with a few simple equations added. From there I leveled up my skills with VB, C#, SQL, HTML, CSS, JavaScript, and TypeScript, and was a fully capable programmer before I started taking formal classes with instructors to direct what to learn next.
Now I find myself on sabbatical and programming just for the fun of it. Sure, I hope some of what I am doing now will translate into a project later that will make money and/or help people, but I would do it again just for the challenge and learning experience. Programming just to solve interesting problems is the primary reason I am able to write code for other goals.
I sometimes wonder how the world might be different if more people were able to take the time to pursue self-directed goals.
You can check out what I’ve been up to here
https://github.com/kevinarthurackerman/Sysx