They're hardly interchangeable.
In some cases you can get away with name and no id, in others id but and no name.
id is supposed to be used to reference an object from script, while name is primarily intended to label form elements (name/value pairs) for get/post requests.
It is a pain, but in most cases you'll be better off putting both on an element that needs identification, and make them equal to the same string.
The weird thing is even if you use id for scripting, if you don't use name for a group of elements you want to appear as a collection (by using the same name string) then it won't work right.
Someday (soon?) Netscape will go away and the world will be easier for developers - though this is probably not the best of all possible worlds for computer users at large.