Geeks With Blogs
Andy Johns' Blog Andy's twisted brain....

Update: it looks like Jeff fixed my comment (and removed the comment I left afterward that basically said, gee my comment got messed up) rendering this post pretty much pointless.... Oh well.... Thanks for fixing my original comment Jeff!

So I wrote what was suppose to be a funny bit of ridiculous code as a comment to a comment on Jeff Atwood's blog about Curly's Law: Do One Thing.

His comment software ate the bulk of the code rendering the joke, well, on me... so if you're getting here because you clicked on my link on the comment, here's the original comment:

"Does that mean you have to not re-use i for loops? :)"

Clearly it means you should only code a for-loop once. I can only assume the prescribed code would look something like this:

public delegate void LoopProcessDelegate(int ndx);

public void Loop(int startNdx,
                           int endNdx,
                           LoopProcessDelegate process)
{
      for (int i = startNdx; i < endNdx; i++)
      {
            process(i);
      }
}

public void TestLoop()
{
      Loop(0, 9, new LoopProcessDelegate(
                  delegate(int ndx)
                  {
                        Console.WriteLine(
                              string.Format("{0} : Hello World", ndx));
                  }));
}

Isn't that much better?

-Andy

<disclaimer>
For the humor-impaired, yes, this is a joke.
Nice article Jeff...
</disclaimer>

Yeah, so it's not that funny. But hey I haven't written an entry in while...

 -Andy

Posted on Tuesday, March 6, 2007 3:03 PM | Back to top


Comments on this post: If you're here because of the Jeff Atwood comment.....

# re: If you're here because of the Jeff Atwood comment.....
Requesting Gravatar...
What is that supposed to mean? I was transferred to this page when pressing a link in some entry. Please explain what kind of code is that and why am I transferred here buying research paper at research paper online ?
Left by Marshal on Dec 29, 2016 1:32 AM

# re: If you're here because of the Jeff Atwood comment.....
Requesting Gravatar...
Accidentally I have come across this site and little bit confused about the subject you are shard here. It describes about Jeff Atwoods comment and unfortunately I didn’t clear that. Please update it more clearly so that the visitors can understand it very easily.https://ccchclinic.com/complete-care-health-center-south-gate/
Left by Danette on Sep 18, 2017 4:43 AM

# re: If you're here because of the Jeff Atwood comment.....
Requesting Gravatar...
This kind is done through the developer number of times because when he/she makes an any page or website of anyone so observe the so many things cause of this little bit mistake is happening while doing it. this kind, of course is being taught in the college and university who relate to the IT and computer science’s course, even those guys who study from online in any university or institute they also be given this kind of task mostly students left higher study cause of some reason so they start cheap online gulf degree in his/her desire faculty easily.
Left by Hicks on Oct 05, 2017 12:33 PM

Your comment:
 (will show your gravatar)


Copyright © Andy Johns | Powered by: GeeksWithBlogs.net