Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
Mohamed Sanaulla wrote:if(false) would always evaluate the else{} and would never evaluate anything in if{}
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Mike Simmons wrote:Of course, it is explicitly allowed in the JLS, which may be giving some people it's a good idea.
I wish Java’s creators had realised they were creating a new language rather than a new version of C.Mike Simmons wrote: . . . Java's creators were trying to emulate a then-common idiom in C . . .
naga eswar wrote:Exactly guys .... the code is from java script.
But either in java or javascript this if block will not execute, we can say its alternate to /* */
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Pat Farrell wrote:Specifically to remove a big wad of code for testing and problem isolation.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:Debugging, possibly; but testing? How can you say you've tested something if you just removed a chunk of code?
Pat Farrell wrote:Easy, problem isolation is part of testing. Removing code makes that easier. Sometimes.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote: Sounds like changing the test to me. Surely isolation is down to your test suite?
Pat Farrell wrote:Sometimes real world debugging is not as easy as the folks pushing JUnit or other Test First methodologies suggest.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |