jump to navigation

Where’s the comment ?? Oktober 3, 2007

Posted by kunilkuda in Curhat.
Tags:
trackback

O yeah..That’s what’s people always ask me about.

Get realistic kid. You’re programmer, and your job is : <gosh!!> reading the source codes !!

Most of us never really really write codes (not from the scratch, I mean). We’re just read someone else’s source code, and fix it when necessary. That’s how the world run, unless you’re God and have remote control to stop the world..

Hey, no kidding here. You’ve only have 24 hours a day. You’ll need at least 5 hours to sleep, 11 hours for yourself, your family, and your social life, and the rest 8 hours for debugging (hmm…where should I put extra 1 hour for coding ??)..

So, instead of adding comments inside your source code, why not coding your codes into self-comment codes..Something like this :

public void updateSprite(long elapsedTime)
{
   float spritePositionX = spriteSpeedX * elapsedTime;
   float spritePositionY = spriteSpeedY * elapsedTime;
   drawSprite(spriteImage, spritePositionX, spritePositionY);
}

There..no need special comments to understand my code right ??

Komentar»

1. Melina - Desember 20, 2007

very interesting. i’m adding in RSS Reader

2. kunilkuda - Desember 28, 2007

It’s an old trick. Originate from Code Complete 2.0 – Steve McConnell – Microsoft Press..

3. Scotia - Juni 3, 2008

Scotia says : I absolutely agree with this !