I've come upon a situation several times in my career when previous developers have done something funny.They will make a control (button) function radically different depending on how the screen was opened or some other condition in the data (e.g., save the data to a txt file vs. do a recalculation of something and store it in a database field). If you're lucky, they've changed the caption on the button when they change the functionality.I've also seen them change the layout of the screen (hide controls, rename them, show entirely new sections). Again, likewise often they change the window caption.This seems to be an anti-pattern because it make it hard for future developer to figure out what any one screen/control does without extensively walking the code and testing. And the temptation that they are falling for that they think they are saving the time to create a second form by creating one that works differently for different conditions.What principle is being violated here? I know of the Single Responsibility Principle; but it doesn't seem to be a perfect fit. I think it's closer to don't do this because it confuses the heck of the users, but I'm not sure if there is anything formal I can point to.
What principle is violated by having a button do two radically different things or screens act radically different depending on the situation
design patterns;user interface;anti patterns;single responsibility;user experience
It's consistency, or also principle of least astonishment.However, your less formal definition seems fine too, more pragmatic.