How DRY is your code?

It’s impossible to use all the design pattern/design principle

there are dozen of design patterns that known and also a dozen of the design principles that already known and used by many engineers, but should we remember all of them and use all of them? For me, the answer is no, in my opinion, design pattern and design principle is just a weapon in engineer's arsenals that engineers can use when engineers thought that weapon is the best choice to use for their cases. So the conclusion is, everything already has its own cases, don’t overuse it :)

Why design pattern/design principle important?

These two concepts are very important because of their impact to make software engineer works much easier(eventually). By implementing this concept, our project will get much cleaner and easier to maintain. it’s very important to keep your code clean and maintainable so, when you need to scale up your project or adding more features, it’s easy to do that without any worries.

DRY: Easiest design principle you should know and understand

DRY, acronym for Don’t Repeat Yourself, in my opinion, is the easiest and very versatile principle that can be used in many tools and many cases. so it’s useful for us to try to understand it and try to implement this principle. just like the name, Don’t Repeat Yourself, this principle encourages us to think to became much more lazy person, and always think to reuse everything, NOT COPY AND PASTE it. I will give some practical examples from my own project of how I use this principle to make my team work easier and faster and of course, cleaner.

Flutter, everything is Widget

Conclusion

DRY is just one of a dozen design principle you could find and use, but DRY is one of the design principles that very versatile and could be useful in many cases and in many tools, so it’s worth to know and understand it :)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store