The Never Executed Loop
-
Just discovered that gem:
private string DoSomething(string input) { int len = input.Length; //fill up, in case leading 0s were lost for (int i = len; i < len; i++) input = "0" + input;
-
Just discovered that gem:
private string DoSomething(string input) { int len = input.Length; //fill up, in case leading 0s were lost for (int i = len; i < len; i++) input = "0" + input;
Cool. An O(zero) loop. ;P /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
-
Just discovered that gem:
private string DoSomething(string input) { int len = input.Length; //fill up, in case leading 0s were lost for (int i = len; i < len; i++) input = "0" + input;
-
I like the positive outlook you have.
Don't comment your code - it was hard to write, it should be hard to read!
-
Just discovered that gem:
private string DoSomething(string input) { int len = input.Length; //fill up, in case leading 0s were lost for (int i = len; i < len; i++) input = "0" + input;
-
Just discovered that gem:
private string DoSomething(string input) { int len = input.Length; //fill up, in case leading 0s were lost for (int i = len; i < len; i++) input = "0" + input;
-
Ooops, I must correct my statement: that code is not thread-safe, it might be executed, and bad things would happen...
-
jeron1 wrote:
there's no bugs
That's not a correct statement, there could still be undetected bugs :)
-
Just discovered that gem:
private string DoSomething(string input) { int len = input.Length; //fill up, in case leading 0s were lost for (int i = len; i < len; i++) input = "0" + input;
Very funny :) . It happens sometimes!
-
jeron1 wrote:
there's no bugs
That's not a correct statement, there could still be undetected bugs :)
I'd like a list of all the undetected bugs, please!
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein -
Cool. An O(zero) loop. ;P /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
Brilliant note, Ravi.
—SA
Sergey A Kryukov
-
Brilliant note, Ravi.
—SA
Sergey A Kryukov
:) /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com