As a UX designer and software developer, one of the best tips I learned was “If a method/function performs more than one task, split it into two separate functions”. This tip helps with easy debugging, logic decoupling, and generally easier code readability.
You may be wondering what this has to do with UX design, it’s pretty easy. If a design component performs more than one task, create two components. For example, if a button performs more than one task, or achieves more than one goal, create two buttons.
Many apps with great UX use this principle. For instance, if you swipe on the Gmail app to delete an unread message, the swipe action only deletes the message. You can confirm this by checking the trash, the deleted message is still left unread.
If this seems like common knowledge then you are doing great! Otherwise, you have learned something new and you can look forward to the amazing things you can do with this tip! Happy designing.