PickVids

"The Clean Code Talks -- Inheritance, Polymorphism, & Testing"

推荐理由

This talk gives a great overview of why boolean flags (rather, if-statements) can be a code smell

推荐Mr_P · 原文

说明

这是2008年由Google TechTalks发布的一部演讲,主题归在Software architecture & design。它讲的是polymorphism over conditionals这一支里的具体问题,而不是把整个领域扫一遍。适合已经能看懂基本术语、想继续往下走的人。内容上可以概括成:Misko Hevery's Clean Code Talk shows how to use object-oriented techniques such as polymorphism to remove repeated if and switch statements. The result is code that is easier to test, understand and maintain.这些读者给出的理由,核心是:HN commenters recommend it as a thorough treatment of replacing conditionals with polymorphism and why flags and deep ifs can be code smells.它贴着当时的技术,看的时候要记得那是那个年份的判断。从2009年到2023年,有3位不同的读者在3个不同月份把它推荐出来,其中明确叫别人去看的有0次。适合一次性看完。讲者把一个判断讲透,演示是在给这个判断配例子。如果已经会了基本定义,就把注意力放在它怎么把polymorphism over conditionals变成能跟着复述的例子。

视频信息

频道
Google TechTalks
时长
38 分 25 秒
发布年份
2008
在 YouTube 打开

同主题更多

想知道新收录了什么?

可选。只保存这个邮箱,不创建账号,也不拿它登录。