On Dec 14, 2014, at 23:50, Leon Sorokin <leeon...@gmail.com> wrote: > > On 12/14/2014 10:45 PM, Robert Williams wrote: > >> I strongly suspect far more code would be *fixed* if the ternary operator >> were changed to match what other languages do. > > If you have 'incorrectly' functioning code today that results in passing > unit tests and a correctly functioning business. Then a sudden change to > the behavior of this code would necessarily result in failing unit tests > and an incorrectly functioning business.
What world is this that you live in where every line of code that’s written is fully unit-tested, where functional bugs in large, highly complex applications are both obvious and immediately apparent? In my world, I’ve inherited millions of lines of legacy code written seemingly to defy the possibility of unit testing, where there are large chunks of code that may run once every several years, and where many types of logic bugs are simply undetectable unless a team of auditors on the business side is double-checking every result of the code. Sure, I also have a million or two lines of newer code that is heavily unit-tested, but even that code has bugs. Given that we have this bug to begin with (and yes, it’s a bug), as well as many of the others that have worked their way into the PHP code base, it strikes me that PHP itself is written in my world, not yours. Hey, reality bites. Also, code that is thoroughly unit-tested is not the code we need to worry about for the very reasons you espouse. If the ternary behavior is changed, the one or two bugs that may be introduced in every several hundred K LOC will become immediately apparent on first test-run and probably be fixed in 30 minutes or less. It’s the crappy code that we have to worry about, the code that’s broken and no one even knows about it. In these cases, I maintain, fixing ternary would only improve the code’s functioning. -Bob -- Bob Williams SVP, Software Development Newtek Business Services, Inc. “The Small Business Authority” http://www.thesba.com/ Notice: This communication, including attachments, may contain information that is confidential. It constitutes non-public information intended to be conveyed only to the designated recipient(s). If the reader or recipient of this communication is not the intended recipient, an employee or agent of the intended recipient who is responsible for delivering it to the intended recipient, or if you believe that you have received this communication in error, please notify the sender immediately by return e-mail and promptly delete this e-mail, including attachments without reading or saving them in any manner. The unauthorized use, dissemination, distribution, or reproduction of this e-mail, including attachments, is prohibited and may be unlawful. If you have received this email in error, please notify us immediately by e-mail or telephone and delete the e-mail and the attachments (if any).