This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The 'd' variable must be initialised outside of the if condition or there must be added 'else' similar as with initialisation of 'c' to any of the conditions at lines 7,8,9.It seems that a compiler doesn't know whether an if condition is passed at line 10 and thus takes a possibility that this condition may not be true.
Ulf Dittmer wrote:"Not smart enough for this task" is the same as "too stupid for this task", isn't it?
I call it too smart to get involved.
Joined: Oct 13, 2005
Agree with Paul Witten. It would be possible to write a compiler which can cope with all sorts of daft code, possibly running through all paths of execution to test whether the value has or has not changed from 2. Of course, it could then take several minutes to compile a 50‑line class, so Paul Witten’s comment is spot on.
Joined: Oct 10, 2012
Campbell Ritchie wrote: Of course, it could then take several minutes to compile a 50‑line class
All joking aside and all trivial code aside, the Big World does have to build systems such as Weblogic Server which already takes a couple of hours on a good box. It's unimaginable how that logic overhead would affect large projects. It might make them unbuildable in our lifetimes. I suppose that's good job security. Or maybe the opposite. "OK, we kicked off the build. You're now laid off because by the time the build is done you'll be 80 years old."
Joined: Oct 13, 2005
Paul Witten wrote: . . . It's unimaginable how that logic overhead would affect large projects. It might make them unbuildable in our lifetimes. . . .
You could probably apply that to Trojans, etc, and we could build anti‑malware programs quicker than the malware.
Joking aside, it would probably run in exponential complexity, so 80 years is quite feasible.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com