Its bugging me a lot so i am turning to the last resort i want to ask
Why is the code below is legal and produces an infinite loop.
is this because there is no condition to stop the loop?(for being infinite loop).
And why are we entering inside the loop
Answer is utterly ridiculous!
126.96.36.199 Iteration of for statement
If the Expression is not present, then the only way a for statement can complete normally is by use of a break statement.
Why would it become a problem?
jake benn wrote:Why doesn't the compiler put the kibosh on that before it becomes a problem?
Why not when its behavior is specified.
jake benn wrote:What is the point of allowing that statement?
No. Null is not false. It are 2 completely different things. This does not compile:
jake benn wrote:Doesn't an empty boolean equal null and isn't null false and thereby allowing this statement to fall through?
jake benn wrote:What is the difference between that and this?
To be honest I see where you are coming from, and you do have a point about writing cleaner, potentially better performing code. I just know that it would be very costly for an organization with hundred of thousands, or millions, of lines of code to go through it all to make those kinds of adjustments. By the time they finished the next version of the language would already be obsolete! I also think that rewriting the code to utilize newer methods, or to no longer use things like deprecated methods, should be done if possible. With limited time and money, however, I know that isn't usually an option.
Now then, as a business owner or investor, it happens sometimes that in order for you to take steps forward, you need to take steps back. Breaking code that was reliant on bugs in a language will only serve to help the company in the long run no matter how many lines of code need to be changed. The number of lines of code will very likely be reduced in the process, causing the maintainability of the code to be more manageable. The BIGGEST cost of large programs is maintenance. I feel that the ends justify the means.
This is true especially on the internet. Security is atrocious, abysmal, and currently irreparable without massive investment in extremely talented programmers who are in VERY short supply. The cost of fixing it without correcting the languages would be orders of magnitude more costly. Because they both cost a great deal of money and time and both destabilize the infrastructure of whoever is using the software, nothing is being done about it at all. Without a paradigm shift here, we will continue to support a system of producing terrible and unstable code to the detriment of everyone. Something must be done. I feel this is the only answer no matter how painful.
Oh and P.S. something like this will increase demand for programmers. Demand increases our pay, and the quantity of jobs available. We would be the beneficiaries of this.