One of the core conflicts for creative artists of all kinds is the tug-of-war between art and commerce. Frankly, an artist needs to make money, and it is preferable to make it from his craft.

A writer who must work a full-time job to support himself will struggle to find the time to work, and often eventually gives it up altogether. On the other hand, being able to write on any project at all can polish valuable skills, and teach one the rules of the publishing industry.

On the other hand, I’ve met writers who were clearly working on projects, or toiling away at a career, that was burning out their souls. I remember meeting one such writer. His business card read “freelance hack and literary mechanic.” Sadly, but not entirely unexpectedly, he was dead of alcoholism within a year.

How to avoid such burnout? Well, in my own career, in addition writing the books I cared about the most, I’ve written Batman comic books, a Star Trek novel, and a Star Wars tie-in. In my television career, in addition to writing for “Outer Limits” and “The Twilight Zone,” I also wrote four episodes of “Baywatch”(!)

And never for a moment did I feel that I was selling myself out. Let’s get something straight: Shakespeare wrote for money. One can keep a careful eye on the bank account, and still reach the heights of craft. But again, how?

In my own case, the answer is fairly simple. Envision the thought process like this: I draw two circles. In the first, is everything I would like to write (and there are always dozens of projects in the mental hopper!). In the second is everything someone else is willing to pay me for. Where the two circles overlap, I write. In other words, are there projects I’d love to write, but can’t get paid for? You bet, and I generally don’t write them unless they are quite short. And there are projects that producers or publishers might want me to do, but don’t touch my heart at all. Having learned through experience that there are limits to my creative flexibility, I turn those down.

But from time to time, an opportunity arises that is in the no-man’s-land between the circles. There is money, but the project isn’t exactly something you have ever considered writing. What then?

Then, you ask yourself if the project is something that you could be proud of. If you would read it, or respect someone who did. For instance, when my agent called and said that the producers of “Baywatch” wanted to talk to me, I had the office send over six hours of video on the show. I sat on the living room couch and watched them with my daughter, who was about six at the time. After a few episodes, I asked her what she thought. She liked it. I asked why. She said: “Because it’s about nice people working hard to make the beach safe for us.” I thought about it, and then replied, “you know? There are worse things than that in this world, by a long shot.” And decided to try writing for it.

Every show, every project has its limitations. You must use certain characters, must get them into certain kinds of situations, and must avoid certain topics. That can be restrictive, but you can also decide to take it as a challenge. After all, you could give Fred Astaire a stage of any kind, and props of any kind, and he would find a way to create dance. Should you be committed to a lesser level of skill and vision? No.

You must find ways to amuse yourself while writing, to stretch your skills by trying something you’ve never done before, by empathizing with a younger audience if necessary—never ever writing “down” to your audience. That is the death of art. But if you can be truly flexible, you’ll find that more doors are open to you, more opportunities arise, that brass ring comes around more often. A writer ready to leap at any opportunity to show his skill, and who finds it easy to fall in love with about a project will often out-perform a brittle “genius” who must have everything exactly his way in order to write.

And if that approach is good enough for the Bard, it’s good enough for me