<p>Let's say that I'm writing a function to convert between temperature scales. I want to support at least Celsius, Fahrenheit, and Kelvin. Is it better to pass the source scale and target scale as separate parameters of the function, or some sort of combined parameter?</p>

<p>Example 1 - separate parameters:
function convertTemperature("celsius", "fahrenheit", 22)</p>

<p>Example 2 - combined parameter:
function convertTemperature("c-f", 22)</p>

<p>The code inside the function is probably where it counts. With two parameters, the logic to determine what formula we're going to use is slightly more complicated, but a single parameter doesn't feel right somehow.</p>

<p>Thoughts?</p>

Go with the first option, but rather than allow literal strings (which are error prone), take constant values or an enumeration if your language supports it, like this:
```
```
convertTemperature (TempScale.CELSIUS, TempScale.FAHRENHEIT, 22)
```
```