Can gerund and infinitive forms be interchangeable when functioning as subject of a sentence?

I am having trouble using gerund/infinitive forms when functioning as subject of a sentence. For instance, which one of these two sentences is correct?

Eating ice cream on a windy day can be a messy experience if you have long, untamed hair.

or

To eat ice cream on a windy day can be a messy experience if you have long, untamed hair.

If both sentences are correct, are these two kind of constructions always interchangeable? Would that only be up to one's stylistic choices?
I am looking for some explanations online but I cannot find anything about them being interchangeable. For instance, on this website called Grammar Bites!, it is said that both constructions can function as subjects but nothing else.

http://www.chompchomp.com/terms/infinitivephrase.htm http://www.chompchomp.com/terms/gerundphrase.htm

This is my first post so I hope I did not do anything wrong. Thanks!


Solution 1:

No, they are not in general interchangeable.

In some contexts, either can be used. But many words require one of the other. For example, "want" takes an infinitive with "to", but does not normally take a gerund phrase (at least in the normal sense: there is a colloquial construction where "X wants Y-ing" means "I think X ought to be Y-ed").