I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows.
I can do
[view1 setAlpha:0.0f];
[view2 setAlpha:0.0f];
for two of the views, but now the third one (the one that should be visible at the start of the app) is not addressed. I put a
[view3 setAlpha:1.0f];
after the first two, because I think it keeps it clear that there are in fact three views, not two as one might think when seeing the code. How do other programmers do this? Is it purely preference or are there some conventions?
If the call is very heavy, it's obviously better to not call it when that isn't necessary, but I was wondering about small things like my example.