defines codeja vu: the feeling that you are coding something that you already coded before. Time to refactor.
That doesn't always mean that it's time to refactor:
Sometimes, you really did code that same thing
before, but it was five or ten years ago and you
aren't even using the same language any more.
James Strachan. James writes:
That "hey wait a minute, haven't I implemented
this once already" thought is quite common,
especially if you've been writing java code for a while.
It ain't just Java.
I've had times where I knew I'd written "something like this"
before, wrote the new thing, and then later found the earlier
version. Sometimes I have ended up having re-invented the
same name, and nearly line-for-line same code.
Or ... I'll be writing something and realize that I need to
write a support routine "over there", so I go "over there"
and start to write the fooRoutine, only to discover that
it's already there -- I had already written that one and
given it the name I just thought I re-invented.