Timeline for Are assignments in the condition part of conditionals a bad practice?
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 13, 2023 at 19:10 | comment | added | James |
if (null === $clientAge) HUH?? Null is always null, why are we testing, what.. ah wait, ok I see now..sigh
|
|
| Jun 15, 2017 at 18:02 | history | edited | Deduplicator | CC BY-SA 3.0 |
added syntax-highlighting
|
| Nov 1, 2016 at 1:36 | comment | added | Mason Wheeler | @user949300 Two words: Stockholm Syndrome :P | |
| Nov 1, 2016 at 0:38 | comment | added | user949300 | After a very brief introductory "getting used to it" period, Yoda conditions are no harder to read than normal ones. Sometimes they are more readable. For example, if you have a sequence of ifs / elseifs, having the condition being tested against on the left for higher emphasis is a slight improvement IMO. | |
| Oct 31, 2016 at 21:14 | comment | added | Mason Wheeler | @Ian Yoda Conditionals that is called. Hard to read they are. Unfortunate the necessity for them is. | |
| Oct 31, 2016 at 21:12 | comment | added | Ian |
Before these warning, we would write CODE_RED = alert so it gave a compiler error.
|
|
| Oct 31, 2016 at 21:05 | history | answered | Mason Wheeler | CC BY-SA 3.0 |