The dominating terms in the calculus of a person's economic circumstances aren't intelligence, will, or moral righteousness.

If you don't start out with wealthy family or relatives to bail you out of emergencies, unexpected expenses of just a couple hundred dollars are devastating and can take months to recover from. Not to mention all the more subtle network driven benefits like getting your foot in the door somewhere or training in professional culture norms and lessons in navigating bureaucracy

When you work a physically demanding low wage job without that fallback, thinking about anything but survival (literally feeding yourself and loved ones -- sometimes including parents) at the end of the day is unlikely. And the smallest lapses in judgement end up being far more catastrophic.

This was my reality for about a decade. I worked in the San Francisco Bay area in grocery stores and restaurants, and held multiple full time minimum wage jobs concurrently.

I had PTSD from a young age, didn't prioritize my formal education after high school (let alone during school), self medicated with drugs and alcohol. Certainly made bad decisions.

I randomly picked up a trigonometry book in my early 20s, was excited by the fact that, given some agency in how I approached the material I could, in fact, understand it -- and eventually self taught up to calculus before deciding to go back to school. I was accepted to UC Berkeley as a transfer student when I was about 26, transferred and studied pure math... While still working two jobs to survive, dealing with housing insecurity as my landlord started aggressively raising my rent, and figuring out how to best allocate the $300 or so leftover after rent and bills were paid.

So yeah, I ended up dropping out. I spent a couple years coming home from my very physical near min wage jobs exhausted but still stayed up late into the night teaching myself to code by building shit in Python and Node, learning SQL and CS concepts.

Doing this was not the cake walk the manic learn-to-code survival bias narratives on Medium might have you think. It took years and involved significant sacrifice to my health to forgo the sleep that I did, and ultimately my success boiled down to someone taking a chance on me. Now my financial calculus is drastically different. Make no mistake though: if I were much older, had a child, were non-white, non-male, had a more severe disability, or had any more unexpected critical expenses over a few hundred dollars, it's entirely possible I would still be broke and toiling away in kitchens

I was able to change my circumstances, but it took many, many years, and a lot of backtracking whenever circumstances (even plenty beyond my control) shifted.

And it required me to effectively make the best possible decision at all times. One thing I find interesting about your question is the implication that fallibility in someone's decision making process means they deserve poverty, and all the horrible shit that comes with it (like housing and food insecurity, and even bring forced to contend with dangerous conditions during pregnancy).

I am no less fallible in my judgement today than I was when I was broke, the difference is that today I can afford to make bigger mistakes.

Anyway, I hope if anything my story helps you re-evaluate that particular point.