Scott Robison wrote:
> --===============0702352335==
> Content-Type: multipart/alternative; boundary=f46d044286d854da5a05042007d5
>
> --f46d044286d854da5a05042007d5
> Content-Type: text/plain; charset=UTF-8
>
> On Sep 28, 2014 12:49 AM, "Stephan Beal" <sgb...@googlemail.com> wrote:
>>
>> Sidenote: i'm curious why most people prefer postscript addition, when
> prefix is "never slower and sometimes faster." (Not that it matters one
> iota for a case like this, it just seems to be very deeply embedded in most
> people i know.)
>
> I think most people (I am not most people in this case) prefer / use
> postfix increment & decrement because it is what they learned first and how
> most examples seem to be written. I prefer to use prefix operators (barring
> the need for postfix side effects) just because they read more naturally in
> my native language. I think it makes more sense when thinking "increment i"
> to see "++i". The fact that it is potentially more efficient (though
> probably not in practice) is just a bonus.

I do it because it's what's most commonly used in C.  For C, any
considerations of efficiency are likely to be negligible, but if
you're writing in C++, the cost of constructing and destructing a
user-defined object *may* mean that using the prefix form has a
non-negligible efficiency advantage over the postfix form.  So, for
C++, it may make sense to get into to habit of using the prefix form,
unless there is a specific reason for using the postfix form.

-- 
Will

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to