2008/7/25 Ben Leslie <[EMAIL PROTECTED]>: > On Thu, Jul 24, 2008 at 6:37 AM, Adelle Hartley <[EMAIL PROTECTED]> wrote: >> When I'm coding in C++, I tend to spell things out more, but I put that down >> to my lack of knowledge & experience. > > Unless there was a reason to use the intermediate variable I would always > use 'run-on dereferencing'. And would probably get people to change to > run-on dereferencing in a code review if I saw it in other people's code.
+1 with 3 exceptions: Run-on until you get to 80 characters, then use a temporary to hold the intermediate value so you can break the line :) I'd use an intermediate if the result of the call requires some error handling, as already discussed in this thread. Finally I'd use a temporary to improve readability of the code, as often the name you give the temporary goes a long way to explaining to the reader what the hell is going on. _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders