It is very important to choose and follow a design/architectural pattern while creating any application. Model-View-Controller is one type of architectural pattern used, which will decouple your UI component from the main logic as it is always advisable to not mix them up (you can have them coupled but, then, changing the UI or logic will be problematic).