OK, but the idea of "simplified" is very relative with expressions.
Some might say the first form is "simpler" (it has fewer parentheses,
for example). And it also depends on what you are trying to "say" with the
expression; if you translate the expression into human language, which
way of saying it makes more "sense" in the particular case.
Thomas Singer wrote:
> I would like to see something like "simplify boolean expressions".
>
> Example:
>
> if (!(a == b && c != d)) {
> }
>
> would be simplified to
>
> if ((a != b)
> || (c == d)) {
> }
>
> Tom
>
>
> At 21:21 13.12.01 -0800, you wrote:
>
>> +1
>>
>> We always try to use this style and not relay on operator precedence.
>>
>> Tal
>>
>> > -----Original Message-----
>> > From: [EMAIL PROTECTED]
>> > [mailto:[EMAIL PROTECTED]]On Behalf Of Scott Sirovy
>> > Sent: Thursday, December 13, 2001 7:21 AM
>> > To: '[EMAIL PROTECTED]'
>> > Subject: RE: [Eap-features] Code Style - parenthesize boolean
>> > expressions
>> >
>> >
>> > +1 -- This is another good code layout option.
>> >
>> > -----Original Message-----
>> > From: Per Mellqvist [mailto:[EMAIL PROTECTED]]
>> > Sent: Thu, December 13, 2001 8:44 AM
>> > To: '[EMAIL PROTECTED]'
>> > Subject: [Eap-features] Code Style - parenthesize boolean expressions
>> >
>> >
>> > I'd like an option in the Code Style settings to
>> > insert parentheses in boolean expressions when not present.
>> > Preferably with some added options for when to use spaces
>> > (not in the innermost subexpr).
>> >
>> > The point of course would be to make the code easier to read,
>> > and not have to try to remember all precedence rules to figure
>> > out what goes on.
>> >
>> > A simple example
>> >
>> > if (a != null && !b.equals("") || c != 0) {
>> > }
>> >
>> > would become (I hope:)
>> >
>> > if ( ( (a != null) && (!b.equals("")) ) ||
>> > (c != 0) ) {
>> > }
>> >
>> > // Per Mellqvist
>> >
>> > --------------------------------------------------
>> > DISCLAIMER
>> > This e-mail, and any attachments thereto, is intended only for use
>> by the
>> > addressee(s) named herein and may contain legally privileged and/or
>> > confidential information. If you are not the intended recipient of
>> this
>> > e-mail, you are hereby notified that any dissemination, distribution or
>> > copying of this e-mail, and any attachments thereto, is strictly
>> > prohibited.
>> > If you have received this e-mail in error, please immediately
>> > notify me and
>> > permanently delete the original and any copy of any e-mail and
>> > any printout
>> > thereof.
>> >
>> > E-mail transmission cannot be guaranteed to be secure or
>> error-free. The
>> > sender therefore does not accept liability for any errors or
>> omissions in
>> > the contents of this message which arise as a result of e-mail
>> > transmission.
>> >
>> > NOTICE REGARDING PRIVACY AND CONFIDENTIALITY
>> >
>> > Knight Trading Group may, at its discretion, monitor and review
>> > the content
>> > of all e-mail communications.
>> >
>> >
>> > _______________________________________________
>> > Eap-features mailing list
>> > [EMAIL PROTECTED]
>> > http://www.intellij.com/mailman/listinfo/eap-features
>>
>> _______________________________________________
>> Eap-features mailing list
>> [EMAIL PROTECTED]
>> http://www.intellij.com/mailman/listinfo/eap-features
>
>
>
> _______________________________________________
> Eap-features mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-features
>
--
Erb
==============================================================
"The only time I like in the morning is afternoon."
- Russell D. Cooper
"If you do everything, then you're all done."
- Melissa F. Cooper
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features