objective c - Bundle declarations into one statement or not? -


given following objective-c example, matter of style , ease of reading keep separate statements or bundle them one? there actual benefits of either? waste of memory declare individual variables?

nsdictionary *thedict = [anobject methodtocreatedictionary]; nsarray *thevalues = [thedict allvalues]; nsstring *theresult = [thearray componentsjoinedbystring:@" "]; 

or

nsstring *theresult = [[[anobject methodtocreatedictionary] thevalues] componentsjoinedbystring:@" "]; 

i take following consideration when declare separate variable:

  • if might want see value in debugger.
  • if accessing variable more once.
  • if line long.

there no practical difference between 2 approaches, however.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -