What verb form follows than? Which would be considered
(a) It's better than buying that store.
(b) It's better than to buy at that store.
And what is the function of than in the sentence above?
Since (semantically speaking) there's a strong connection between the
after-the-than phrase and the subject pronoun "it,"
you must conclude that if "It" refers to a gerund (since very
few infinitives function as subjects) then "buy" must also
be a gerund. If "it" refers to an infinitive, the same applies.
Buying a car from her is better than
buying a car from him.
To stay up until all hours is better than
to sleep through all the action.
Than can function as a preposition or as a conjunction.
"When than is followed by a noun or pronoun,
it functions as if it were a preposition. When followed by a clause,
it functions as if it were a conjunction." (L.G. Alexander, Longman
English Grammar, Longman, 1988.)
According to this description, than in Sentence (a)
can be considered a preposition, since buying, a gerund,
is the noun form of the verb. It could be paraphrased in this way:
In sentence (b), than can be considered a conjunction:
(a) It's better than that.
(b) It's better than (it is) to buy at that store.
So, both sentences would be correct.
It's important to keep Linda Cahill's thoughts about parallelism in
mind; the referent of "it" in "it's better" should
determine whether to use the gerund or infinitive form in a sentence