![]() |
How do YOU style it?
Ive been curious about whats the most common styling with using true/false variables, so I figured Id make a poll about it.
Alternative A: PHP Code:
Alternative B: PHP Code:
I, personally, go with alternative A. |
I actually just style it depending on how I feel like doing it.
But, mostly, I believe I do Alternative B, though sometimes I do stuff like PHP Code:
|
B...
Why check a boolean variable is true and then have the if statement check the result of that? B just seems more efficient. |
Quote:
I also like to do stuff like PHP Code:
|
Personally I'm a fan of the cutoff look
|
Option B
|
I tend to go with B, especially when the variable name makes sense, such as this.pathIsBlocked.
|
Haha, im totally in a minority here..
|
Quote:
|
Didnt vote for anything because of...
PHP Code:
|
I prefer alternative A, because you find things better and its more comprehensive =]
|
I normally use (and prefer to use) B, since there is little point in the engine essentially doing (var == true) == true, not sure if it's folded in the bytecode.
I do use A sometimes, though. |
I prefer B, I think A comes from C++ where it sometimes looks better when you show that you make a boolean comparison and not some check-for-valid-pointer hack.
A is also slower although the comparions-operation is not really that slow. It looks a little bit weird to compare with true or false though, "if (true==true)" |
Quote:
|
I prefer A since I like the way it looks.
|
I prefer method A.
However recently I found myself using method B because there is a bit less to type. |
| All times are GMT +2. The time now is 10:59 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.