Is Belt and Braces programming good practice or just introducing needless complexity?
问题 I was wondering whether using a Belt and Braces (Suspenders) approach to programming - and to data validation in particular - was good practice or not. This came about from the following example. I was creating a form and I added Listeners to all the fields which should mean that the OK button is only enabled if all the fields in the form have valid values. I was then writing the code which was run when the OK button is clicked. The pessimistic side of me decided that Belt and Braces never