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

Popular posts from this blog

Prolog - Listing -

orchardcms - change base url in local copy in Orchard CMS -

linear regression - Trying to get confidence/prediction intervals with `predict.lm` in R, but I keep getting an error regarding my dichotomous variable -