IF the program update has the same name and sits in the same folder, the Dock icon don't care what version it is
The two key words in that rule are "
same name". I don't think there is any OS in use that will allow two items of any category to have the same name in the same directory. A good file manager app will ask the user to select one or the other before allowing the new item with the same name into that directory. A better file manager app will also offer an option to automatically rename the original item and then allow the new one.

In another thread, I reported my having had my 2.2.2 copy of WC labeled with that version number as a suffix.
That's what the Dock icon was related to. And that's what it activated; exactly the app it was associated with. There was not, as yet, any icon for the newer version of WC to select/use/click/etc. That's simply another reason I don't use the Dock any more than absolutely necessary, it adds another layer of abstraction between the user and the file he wants to open.
OS X is, indeed, very intelligent, but it still cannot read even my feeble mind, perhaps because so much of it is gone?!
![Lol [lol]](https://athena.trixology.com/Smileys/default/lol-1.gif)
As for keeping the old version. Who said the new one was perfect? Who said the new one would not have a problem not discovered during it's development and testing? Why throw away what was working perfectly just prior to getting the new version. Thanks, but no thanks, I've done enough beta testing to not rush to the trash can with any old version just because a new one was installed. I usually simply zip the old one and keep it for a few months/years. Nor do I download/update anything the hour/day/week it becomes available! Call me paranoid if you want, but remember, these are human made products and humans are well known for making misteakz!
![Coffee [coffee]](https://athena.trixology.com/Smileys/default/morningcoffee.gif)