On Thu, May 26, 2011 at 10:59 AM, Terry Reedy <tjre...@udel.edu> wrote: > On 5/26/2011 10:34 AM, Ronald Oussoren wrote: >> >> On 26 May, 2011, at 16:10, Eric Smith wrote: >>> >>> >>>> and make silent the Clang Static Analyzer :-) >>> >>> I care less about that than maintainability and future-proofing. > > >> Have to looked at the patch? The patch and resulting code look sane to me, >> and if anything at most of the updated segments look cleaner after the >> patch. > > Lets assume that the function currently does what it is supposed to do, as > verified by tests. Then adding an unneeded increment in case the function is > redefined in the future so that it needs more code strikes me as YAGNI. > Certainly, reading it today with an unused increment suggests to me that > something is missing that would use the incremented value. This strike me as > different from adding a comma at the end of a Python sequence display.
Sorry to butt in here, but I agree with Eric that it was better before. There is a common idiom, *pointer++ = <something>, and whenever you see that you know that you are appending something to an output buffer. Perhaps the most important idea here is that this maintains the *invariant* "pointer points just after the last thing in the buffer". Always maintaining the invariant is better than trying to micro-optimize things so as to avoid updating dead values. The compiler is better at that. -- --Guido van Rossum (python.org/~guido) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com