Anonymous Confessions from Programmers.
When I have to programmatically create an user interface I usually do something like "origin.y = offset + 3 + 5 + 40*3 + 5".
( 94 )
( 139 )
No idea why this is being condemned - this is a pretty good idea. It demonstrates the thought process that's gone into the location of the object, e.g. 3px for the border, plus a 5px margin, then another 40px per icon, and another 5px for the right margin. A comment wouldn't hurt, but this is just a novel example of descriptive programming.
Not really, it would be better if those magic numbers were set to const variables or at the very least #DEFINEs, with those magical descriptions for them you so magically provided
is it wrong?? :) #magic-numbers
Is there another way of creating a UI for iOS devices? I guess not