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”

Image: Courtesy



Contact Form

By clicking 'Submit' you Agree to Guvi Terms & Conditions.

Our Learners Work at

Our Popular Course

Share this post

Author Bio


Our Live Classes

Learn Javascript, HTML, CSS, Java, Data Structure, MongoDB & more
Learn Python, Machine Learning, NLP, Tableau, PowerBI & more
Learn Selenium, Python, Java, Jenkins, Jmeter, API Testing & more
Learn Networking, Security Testing, IAM, Access Management & more

Hey wait, Don’t miss New Updates from GUVI!

Get Your Course Now

Related Articles