objective c - #define ... method call. Why? -
i have come across of sort of thing in codebase need across:
#define timestamp [nsstring stringwithformat:@"%d",(int)([[nsdate date] timeintervalsince1970]) ]
why this, opposed creating method in implementation? seems such odd thing do, there must benefit it.
i have seen done in c lot, make code inline rather in separate function
it removes overhead of calling function, when function line long.it forces inline
pretty compiler make small function in-line anyway there isn't reason this. more of stylistic choice. error-prone
Comments
Post a Comment