Why is it important to separate UI code with your logic and also make your function does one thing and one thing only?
I ran into a piece of code today that illustrates this well:
performRotation()
{
do a bunch of rotation related task
update UI to show rotation arrows
}
Then suddenly one day we came up with a new way to interact with the UI (say you use a tablet now). With tablet stylus, unlike with mouse, when you rotate, you don't want to display the rotation arrows. Guess what, you can no longer use performRotation without making changes to your code in it because the UI is also tied to the task, but the spec for UI is now different.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home