'to' / 'rather than' / 'but' [duplicate]

Your first sentence is the normal construct. Your second sentence is an absolute sense, and is slightly different but still grammatical. Your third sentence is not grammatical to me.

In your sentence that prefers walking to taking, yes, taking and walking are both -ing forms, so are comparable.

The OED says that the normal construct is

III. 7. a. To set or hold (one thing) before others in favour or esteem; to favour or esteem more; to choose or approve rather; to like better. With simple obj., inf., or clause; above, †before, to. Now the chief sense.

Notice that before is marked with the obsolescing obelisk. They provide citations that include these:

  • 1560 Daus tr. Sleidane’s Comm. 24 ― He preferreth his owne decrees··before the Scriptures.
  • 1661 Boyle Style of Script. (1675) 165 ― He should not scruple to prefer the end to the means.
  • 1680 Morden Geog. Rect. (1685) 322 ― We may justly prefer it before the other parts of the World.
  • 1778 Hist. Eliza Warwick I. 25 ― He would prefer seeing his daughters dead at his feet, than behold them wedded to the worthiest men without titles and riches.
  • 1815 J. W. Croker in C. Papers (1884) 20 July, ― He preferred living like a Grecian, to dying like a Roman.
  • 1882 Froude in Fortn. Rev. Dec. 734 ― Warlike races prefer to be under a chief.
  • 1883 G. Moore Mod. Lover II. vi. 105 ― There was one place he preferred above all others.
  • 1895 Lieut. Maguire in United Service Mag. 378 ― Because the Chinese preferred the doctrines of Confucius to ordinary military common sense.

The absolute sense that you use in your second sentence is covered by the OED example of:

  • 1902 Edin. Rev. Apr. 512 ― He prefers rather than excludes.

The first use is the normal Bitransitive construction with prefer; i.e, prefer has one volitional subject A, who is the deemer, and two objects, the first of which X is deemed preferable to the second Y, which is marked by to, and must appear after X.

  • A prefers X to Y

The second use is quite different; there are two clauses: the main one and an adverbial clause beginning with rather than. The verb in the main clause is the simple Transitive (not Bitransitive) prefer, which simply takes one object and awards it the preference.

  • A prefers X

The rather than clause that explains what Y was, since it is adverbial, can be fronted easily, while the bitransitive construction has strict word order.

The third sentence is simply ungrammatical. But is not that kind of conjunction.

The key is that different modalities of "the same" verb -- in this case bitransitive versus simple transitive prefer -- can get to the same point via different routes.


As a footnote, I would mention that the syntax and semantics of comparative and superlative constructions (like Bitransitive prefer X to Y) is considered to be one of the most complex and difficult in linguistics.