txtContent.setCaretPosition(txtContent.getCaret().getDot());
Look at that! How does that happen? When you see logic written like that you have to wonder what goes through the developer’s mind as he keys it. I know, I know, in today’s age of modern IDEs you can sometimes blame the computer for writing stoopidity like that in an awkward refactor command or something. The difference is that I remember writing the logic. I remember what my intent was. I remember saying, “hmm… that doesn’t look necessary but it fixed the problem.” I was in some ugly code way deep at the time. Have you ever added something that you knew was dumb only to find out later how idiotic it was?

Hmm. Sounds like code that needs a comment, like:
// NOTE this makes XX happen.
By: Merlyn Albery-Speyer on March 10, 2007
at 1:24 am
Here’s a comment for my above example:
//This code moves the cursor to it current position
//Verynecessary do not remove at the risk of world destruction!!!
txtContent.setCaretPosition(txtContent.getCaret().getDot());By: Cliff on March 10, 2007
at 8:43 pm