in reply to Re^6: quickness is not so obvious
in thread quickness is not so obvious

> Use the postfix form when using ++ or --in an expression. To be consistant with i += 1

but isn't this - as a sub expression - effectively a preincrement?

Cheers Rolf

PS: Je suis Charlie!

Replies are listed 'Best First'.
Re^8: quickness is not so obvious
by GrandFather (Saint) on Jan 24, 2015 at 22:05 UTC

    Not only is it a preincrement, but the increment operator is on the left so when parsed by my eye i += 1 looks more like ++i than that other option.

    So the rationalising failed on both counts!

    Perl is the programming world's equivalent of English
Re^8: quickness is not so obvious
by RonW (Parson) on Jan 26, 2015 at 06:39 UTC

    I didn't say it made technical sense.

    As a foot note to the quoted guideline: The guideline maintainers consider i++ to be shothand for i += 1 and consider the i++ form to better imply that relationship than the the ++i form.

    Again, I did not say it made technical sense.

Re^8: quickness is not so obvious
by RonW (Parson) on Jan 26, 2015 at 18:04 UTC

    Also...

    Under "our" guidelines, i += x would not be a sub-expression.

    RonW said:
    There are also guidelines that specify that an assignment or assignment-like operator must be the left most operator in expressions and only one is allowed.

    I guess I should have included those in the <ul> list in my earlier post.

      So you are not allowed to use goatse?

      Does this rule also exclude call(i++) ?

      Cheers Rolf

      PS: Je suis Charlie!

        Does this rule also exclude call(i++) ?

        Yes. Increment, decrement and assignment operators are not allowed in expressions that are parameters to functions.