Design Patterns: Don't Repeat Yourself in C#

preview_player
Показать описание


Have you ever heard the term DRY, as in "Keep your code DRY"? DRY refers to one of the foundational design principles in programming. It stands for Don't Repeat Yourself. On the surface, that sounds so easy to do. However, as you will see in this video, there is a lot to think through when trying to get this right. From thinking through where to put code to ensuring that you don't repeat yourself in testing and bug fixing, there is a lot beneath the surface of simply keeping code DRY.

0:00 - Intro
0:53 - recognize and anticipate repetition in your code
4:44 - create a discrete method and make it independent
7:40 - class library - why and how to
16:05 - bringing the class library into other projects
21:55 - briefly on updating dll files - NuGet packages
22:28 - DRY in development work - unit tests (crash course)
41:51 - how to make the class library more versatile - consider .NET Standard
44:47 - video summary
46:32 - how far to take DRY: general tips
Рекомендации по теме
Комментарии
Автор

I am impressed, I had watched some very famous (paid) instructional sites but did learn this much. Your videos are exceptional and convey so much information in 50 min or so that others take hours and hours and still not clear. I don't know why I did not find you before. I know this clip old but still good. 5 stars

mrf
Автор

0:53 - recognize and anticipate repetition in your code
4:44 - create a discrete method and make it independent
7:40 - class library - why and how to
16:05 - bringing the class library in to other projects
21:55 - briefly on updating dll files - NuGet packages
22:28 - DRY in development work - unit tests (crash course)
41:51 - how to make class library more versatile - consider .NET Standard
44:47 - video summary
46:32 - how far to take DRY: general tips

RalfsBalodis
Автор

I have been a software developer for 1 year in the industry, and I have been coding for 4 years. This is, the first time, I have ever seen someone use a do-while loop.

derrickmiller
Автор

This series is actually what every programming teacher should teach us.. DRY is spectacular idea

MiikaKontio
Автор

Tim, your work is one of the reasons i don't regret choosing C#. Thank you and keep going!

tarlanismailov
Автор

I could thank you for many things, but since you ask me to not repeat myself, I will just say THANK YOU FOR EVERYTHING!

franciscooliveira
Автор

I will have you know... that watching your videos has helped me land a JOB by giving me great information which directly helped answer some interview questions! Now I'm in an environment where real pros are getting me up and running on working on some challenging and rewarding projects, paving the way for the future. But this just means I need to watch more of your videos until I have seen them all!

Vasly
Автор

I've watched 100+ hours of Tim's videos and so I've heard about the DRY principles many times. Therefore, I figured I wouldn't learn much new information from this video. While a lot of it I did know, there were several gems that I took away and added to my developer quill. Thanks Tim!

BoilermakerRV
Автор

You’ve been so much more than a teacher for me. Thank you for everything you have done for us!

Jihed
Автор

That's a good demo of refactoring. In my opinion, it is also an example of separation of concern: you extract the business logic and make it independent of UI or whatever environment specific stuff.

adamding
Автор

You are great teacher that I ever had in programming... Very precise explanation... Everything you pointed out, you explained it with example... Really cool! Even sometimes we thought we have already known it, but after watching your video, there are still having some rooms to improve our code. Thank you Mr. Tim, you are awesome.

zulhishamtan
Автор

Very useful, thank you!
Also for those poor souls who come in later to maintain other people's code. I recently had a situation where we generated basically similar PDF files from three different places in the code. Stuff I had fixed in one place was reported as "Not fixed" by testers using other paths in the code. Not to mention when I tried to get all the bugs fixed in all three places. Fortunately, refactoring turned out to be easier than fixing things thrice :)

HenrikRClausen
Автор

You are an awesome speaker and your tutorial on SOLID is a must watch

akjkumar
Автор

Just started my journey of daily learning or weekly learning in your videos. Hope that I could finish it all!

rodolfoiiiperez
Автор

Thumbs Ups! .... I am always reluctant to point out things in videos that most often it is a matter of personal choice and can be debated as pro\con. The one design difference I probably would consider is eliminating the hardcoding of the length of "4" characters because it is hardcoded in multiple locations, thus increasing the risk of throwing an exception for something as simple as a typo-o change in code where "4" inadvertently becomes "5" in one line of code. Ideally, it won't slip past the unit tests.

nrnoble
Автор

I agree with the many positive sentiments here. Even with a lot of experience under my belt, there is always something new and valuable to learn from these videos. All of them -- just excellent! Thanks.

cbc
Автор

You make things so clear and loud. You voice is just catchy and loved to learn through your voice.

joyfulitconsultant
Автор

Keep up the good work Tim! I really really enjoy your video's. I'm a developer with 35 years of experience, but I still learn from you on a weekly basis. No kidding. Tripple Tumbs up !

VLRuud
Автор

Amazing! Simple to understand and employ with your examples and thorough explanations and reasoning for doing so. I learn so much from watching and practicing what you teach. Thank you for taking the time to share your experience with us.

jimkeifer
Автор

I really love your calm and educational movies. This one finally got me understanding a lot of the C# solutions thinking, when I’ve previously just used other languages and the references have just been a mystery before. But this movie solved a lot of my mysteries. Thank you Corey!

Pownas