The obvious answer to that question is: both. So why would I bring it up? A few years ago I taught a short course on grammar to a group of adults. I assumed the people who signed up for the course were interested in improving the quality of their writing. For some, this was true. But a few, one in particular, seemed more interested in discussing the nuances of “the rules” than in generating readable prose.
The problem student’s not-so-hidden agenda for taking the class was to be able to win arguments with her boss. She wanted to argue her rightness and someone else’s wrongness. Her questions went along the lines of “but which punctuation would you use if.” The situations she posed became absurd, and the resulting, technically-correct sentences just sucked.
At some point you need to get past merely satisfying the rules and rewrite a sentence when it’s not working. “The rules” are more relaxed in fiction than in non-fiction and business communications. We get more leeway in fiction. We are encouraged to develop a distinctive voice. And you can get away with anything in dialogue. In non-fiction grammar counts more because you must maintain credibility. A serious slip in the conventions of grammar will undercut your expertise.
Besides, in many cases these days, one person’s rule may be another’s preference.