I think this is perfectly unreadable I would prefer:Chan Rasjid wrote:I think most of us should easily know this is perfectly safe :-
- Code: Select all
If (exprA && (w = bitboard1 | bitboard2)){
if (w & bb ){
....
}
}
- Code: Select all
if (exprA && (bitboard1 | bitboard2) && bb) {
....
}
- Code: Select all
if (exprA) {
w = bitboard1 | bitboard2;
if (w && bb) {
....
}
}
Putting the assignment into an expression does not give you any benefit but will introduce bugs sooner or later when using it too often.
You may find even more examples of the 'undefined' type, and I propose not to bother with it if your goal is writing good code.Chan Rasjid wrote:
- Code: Select all
a = b + (b = 1);//undefined
a = b + (c = c + 1);//ok
a = b + (c = c++);//undefined
Sven