In technical writing, we often need to describe things that have a certain purpose: the menu item whose purpose it is to save a file, the code whose purpose it is to send a message, and so on. A colleague and I have different intuitions as to the correct form for these noun phrases. In the following table, which column is correct/preferable and why?
| "to" + infinitive | "for" + gerund |
|---|---|
| the menu item to save the file | the menu item for saving the file |
| the code to send the message | the code for sending the message |
| a globally unique ID to identify the form | a globally unique ID for identifying the form |
| the repository to load data from the database | the repository for loading data from the database |