Programming tip of the day – DRY principle

Hello Programmers,

Day in and Day out, Rajesh was writing code.  He was hard working, so he wrote code all the time.  But whenever his manager asks him to change some functionality, he takes a long time.  Manager becomes frustrated because he was not getting the output fast enough.  As days passed by, outputs became that much longer and the quality also reduced.  Rajesh was also frustrated.  He was always hard working, but had to work more and more harder as days passed by even to make small changes.  What was the reason?  Rajesh’s friend Vaibav came to help.  He found that Rajesh was not reusing the code that he wrote earlier, thereby duplicating code across the project.  Over a period of time, maintenance became difficult for Rajesh.  Then Vaibav suggested “Rajesh, always follow the DRY principle“.  Rajesh didn’t know what it was.  Vaibav suggested “Don’t Repeat Yourself 🙂 Always try to reuse code you or someone wrote earlier, because if you don’t, it is a waste of time for everyone”

DRY
Image: Courtesy deepubalan.com

 

MORAL: DON’T REPEAT YOURSELF.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s