If you want to force compiler errors to avoid silent breakage, and
change the interface to be better, you could introduce a new type:
ConnectionLoginDetails (or some other more appropriate class name).
You could give that a constructor with your new preferred order of
parameters, or maybe even allow something like this:
Connection
connection(ConnectionLoginDetails().Database("whatever").Server("localho
st").Password("noh4xzorssszz"));
Each of those functions returns a reference to the object so you can
daisy chain the params in any order you like.
It's a bit more verbose, but I guess it would allow people to choose
their preferred order, allow you to specify the most common default
order as a constructor, produce compiler errors on upgrade, eliminate
(almost) the possibility of mixing parameters up, and as an added bonus
(wait for it!): in my projects I tend to have a struct or a class that
holds this info anyway (and I bet most other people do too):
Connection connection(details.Database(), details.Server(),
details.User(), details.Password());
May as well pass them as one param.
Joel