Liz Beigle-Bryant took her first programming class, BASIC, in 1973. At the time, computers were part of the math departments instead of the engineering departments, she recalls. And because she had a background in family art, everyone at her high school discouraged her from doing so.

Beigle-Bryant, now 57, didn't revisit coding again until a couple of years ago, when she signed up for Codecademy's free online tutorials. Though there was no immediate payoff, she found learning the skill helped ease the inevitable discouragement that comes during a job hunt.

"I felt like I was accomplishing something instead of wasting time on Facebook or [playing] phone games," she says. "It helped me feel better about myself so I could project a better image."

See also: The 8 Hottest Tech Jobs of 2014

In 2011, Beigle-Bryant was part of a round of layoffs at Microsoft, where she had worked as an administrative assistant. That career path was, by her estimate, her fourth one. Others included a job as a costume designer on the short-lived series Hypernauts in 1996, which at least got her a mention on IMBD.

In her mid-50s, Beigle-Bryant decided on a fifth career. During her unemployed period, she spent up to eight hours a day on Codecademy learning HTML and, later, Python. Eventually, she accrued the skills to land a job at the University of Washington (where she has held various roles, including migrating data), though she wound up falling back on her business administration background. Though it wasn't exactly what she had in mind, Beigle-Bryant says she's thankful. "As you get older, you're an expensive commodity [to an employer]."

Liz Beigle-Bryant Image: Liz Beigle-Bryant

Faced with similar situations of unemployment, many bemoan their fates and even give up looking for work. Others, like Beigle-Bryant, learn new skills such as programming to make themselves more attractive job candidates.

Consider the stats: The U.S. unemployment rate in July was 6.2%, according to the Bureau of Labor Statistics. The rate for programmers, meanwhile, is 1.3%, and the segment is projected to grow 8% over the next decade or so. Some recruiters believe there are as many as five jobs open for every applicant. As a result, the median salary for a programmer is $76,140, versus a median of $46,440 for all jobs.

The shortage of qualified applicants has led employers to lower their standards. A computer science degree is now a bonus rather than a requirement. Oftentimes, successful hires aren't even college graduates.

"I would say [we're looking for] anybody that can program," says Nicole Tucker, a recruiter for iCIMS, a New Jersey-based SaaS provider. "It's definitely the ability to be a problem solver. They have to be intellectually curious." Tucker adds that iCIMS has hired people who have learned to program via Codecademy or Coursera, another tech company that offers open online courses.

Stephen Babineau opted for something a bit more rigorous. Earlier this year, Babineau, who is a comparatively young 27, was accepted into Code Fellows, a Seattle-based company that provides intense boot camp-like courses that promise programming proficiency — even if you've never coded in your life.

Babineau, a former production assistant on Breaking Bad, among other projects, grew tired of 14-hour workdays. He also envisioned himself having a hard time with the physical demands of the job as he got older, which led him to try out for Code Fellows. Despite a lack of any programming knowledge, he was accepted and moved to Seattle for an eight-week program in the spring.

It was hard work. Babineau says he studied at Code Fellows 12 hours a day, five days a week — and then did homework on nights and weekends. "In about the sixth week of the program, I got horrific eye strain," he says. "I talked to the teacher and he said take a night off, your sanity will much improve." Babineau took the advice and made it through the final leg of the program.

But it wasn't all drudgery. "I actually found that I enjoyed programming," he says.

Tucker says she looks for that passion in potential hires. The problem is, mid-career switchers aren't necessarily motivated — at least at first — by a love of coding. Inevitably, the lure of a higher salary and job stability have trumped their initial passion. That's why people are switching in the first place.

A recent study shows that switching careers solely for money and stability is a bad choice. Amy Wrzesniewski, an associate professor of organizational behavior at the Yale School of Management, and Barry Schwartz, a professor of psychology at Swarthmore College, who led the study, looked at 11,320 cadets in nine entering classes at the United States Military Academy at West Point. They found that those with strong internal motives for success did better than those who were highly internally motivated but also strongly influenced by "instrumental" motives like the ability to secure a job later in life.

"Remarkably, cadets with strong internal and strong instrumental motives for attending West Point performed worse on every measure than did those with strong internal motives but weak instrumental ones. They were less likely to graduate, less outstanding as military officers and less committed to staying in the military," the professors wrote in the New York Times.

In other words, if you like fixing things and solving puzzles, you'll probably be a better coder and enjoy work more than someone who is merely doing it for the paycheck. But that goes for many lines of work.

The programming life isn't for everyone, but for those who have a passion for it, there are jobs galore — even if you're not as young as these guys. Image: Jessica Rinaldi for The Boston Globe via Getty Images

It's not always clear, however, if you'll enjoy coding. So you might try Ryan Hanna's method.

Hanna, now 30, spent his first seven years in the workforce in IT. He had a very limited knowledge of coding, so he started teaching himself via Codecademy in 2012. Starting with HTML, he moved on to CSS and JavaScript. "I've been through every one of their things," he says. Eventually, he was putting in 16 hours a week. "Sometimes I forced myself to do 30 minutes. Other times, I picked my head up and three hours had gone by." After five months of this, Hanna began working on building an app called Sworkit, which generates random exercise routines to meet your schedule.

Hanna thought 100 downloads sounded like an exciting number. But after the website Lifehacker ran a story on Sworkit, he got 10,000 downloads in the first month. This year, Hanna sold Sworkit to Nexercise, which hired him as well. He now has a whole new career.

It doesn't always turn out that way. Zach Sims, cofounder of Codecademy, says a minority of students finish Codecademy course — which is what you might expect since anyone can start one. Either way, since the courses are free, it can't hurt to try. "There is this common misconception that programming involves deep math knowledge," Sims says. "But it's gotten easy and abstract enough for most people."

At the very least, spending a few hours on Codecademy will offer a better understanding of some of the technologies that largely pervade our lives in 2014. "It's never going to hurt to understand or demystify the technology," Tucker, the iCIMS recruiter, says. "Even if you don't ever land a programmer job."