Closed ColinEberhardt closed 10 years ago
My vote: yes. Reason: it's a useful part of the language.
I would say use it for your own structs or third-party ones without helper functions/macros only.
I think the (semi-)official Apple line is to use the CGGeometry functions for creating and accessing CGRect
s and that's more what you see out in the wild too.
I prefer CGRectMake
. I feel it's more widely adopted.
+1 CGRectMake
+1 on using the Apple provided geometry functions.
Also if you ever use blah = (CGRect){...} you immediately start a comment war on "what if Apple changes the CGRect underlying structure one day?"
+1 CGRectMake
and similar.
+1 on always using the geometry functions, as per the documentation
While tech editing i7t I realised we have an inconsistency with some people using compound literal syntax:
Should we use this less-often used, yet highly useful syntax? Or use the
CGRectMake
macro for simplicity / familiarity?My gut feeling is that we should use this feature, but ensure that the code style guidelines are easily discovered by reader (i.e. linked to by every tutorial), and that we make one goal of the style guideline to be educating the reader.