"The Clean Code Talks -- Inheritance, Polymorphism, & Testing"
Sign in to YouTube
Sign in to YouTube
Sign in to YouTube
Uploaded on Dec 4, 2008
Google Tech Talks
November 20, 2008
ABSTRACT
Is your code full of if statements? Switch statements? Do you have the same switch statement in various places? When you make changes do you find yourself making the same change to the same if/switch in several places? Did you ever forget one?
This talk will discuss approaches to using Object Oriented techniques to remove many of those conditionals. The result is cleaner, tighter, better designed code that's easier to test, understand and maintain.
Speaker: Misko Hevery
-
Category
-
License
Standard YouTube License
Loading...
Loading...
Loading...
Loading...
Loading...
-
37:57
The Clean Code Talks - Don't Look For Things!by GoogleTechTalks
74,574 views
-
1:00:18
How To Design A Good API and Why it Mattersby GoogleTechTalks
173,675 views
-
1:18:41
How to Write Clean, Testable Codeby GoogleTechTalks
68,674 views
-
32:08
"The Clean Code Talks -- Unit Testing"by GoogleTechTalks
95,306 views
-
55:16
Google I/O 2009 - The Myth of the Genius Programmerby GoogleDevelopers
219,266 views
-
81
videos
Play all
Tech Playlistby deecm22
-
1:05:21
Transform Your Mind, Change Your Brainby GoogleTechTalks
524,992 views
-
3:23
01 07 What is polymorphismby bugsfix
5,298 views
-
55:27
How Cybercriminals Steal Moneyby GoogleTechTalks
134,634 views
-
2:45
Robert C. Martin Talks About his Book Clean Codeby ElapseTechnologies
4,032 views
-
1:25:08
Three Cool Things About D - The Case for the D Programing Languageby GoogleTechTalks
26,632 views
-
1:33:20
Self-Organization: The Secret Sauce for Improving your Scrum teamby GoogleTechTalks
70,390 views
-
57:31
Becoming a Software Testing Expertby GoogleTechTalks
59,749 views
-
58:08
No Time to Thinkby GoogleTechTalks
131,286 views
-
1:08:04
CMake/CPack/CTest/CDash Open Source Tools to Build Test and Deploy C++ Softwareby GoogleTechTalks
31,724 views
-
43:54
How to Hack a Web Site - Dr. Susan Loveland - Lunchtime Talks in Science and Mathematicsby AdamsState
587,646 views
-
1:04:06
2007 Google Tech Talk: Focus Fusion - The Fastest Route to Cheap, Clean Energy?by FocusFusionSociety
14,039 views
-
59:34
Automated Testing Patterns and Smellsby GoogleTechTalks
42,200 views
-
1:00:37
jQueryby GoogleTechTalks
308,081 views
-
2:58
Bjarne Stroustrup: Why the Programming Language C Is Obsoleteby bigthink
84,705 views
-
56:31
Teaching Kids To Codeby GoogleTechTalks
72,099 views
- Loading more suggestions...
Top Comments
neurosearch 4 months ago
I'm getting tired of listening to such bad excuse for not writing clean code, maybe your co-workers should find another job instead of complaining about learning something new (it really isn't new, just something you don't learn detailed enough in school)
Have you ever tried to make a review or maintain an if/ switch - that just got bigger for each new feature?... that is not funny!!
Sign in to YouTube
Sign in to YouTube
Jonothan Farr 2 years ago
@Hax0rPr0n You're completely missing the point of the object oriented method and in particular an OO principle called the Open Closed Principle which states that software modules should be open for extension but closed for modification. This property allows us to add capabilities to a software system by adding new modules (i.e new subclasses) without incurring the risk of changing existing code. That's the main reason to favor inheritance over conditionals, it has nothing to do with clarity.
Sign in to YouTube
Sign in to YouTube
All Comments (129)
Amir Halperin 2 weeks ago
Another great talk from Misko Hevery.
10x
Sign in to YouTube
Sign in to YouTube
Shockszzbyyous 3 weeks ago
why wouldn'tyou write code that is easier to read and is cleaner ?
there is just no reason to not do it ...
Sign in to YouTube
Sign in to YouTube
Nikolaii99 1 month ago
i'm a complete noob... so i'm trying to learn how to organize my programs/applications into a collection of classes... and wrap my head around object oriented programming... i think this was helpful for understanding polymorphism (even to a beginner)... And it really makes me think about different ways to go about coding... The only thing i didn't understand was Guice... i'll have to look it up and learn more about it.
Sign in to YouTube
Sign in to YouTube
allyourcode 2 months ago
re expression modeling interview question: bonus points for visitor pattern :P
Sign in to YouTube
Sign in to YouTube
allyourcode 2 months ago
What about laden vs. unladen swallows? How can I effectively model that with single inheritance?
Sign in to YouTube
Sign in to YouTube
peng yu 2 months ago
eval can save the operator subclass! Kind of java person would do this...
Sign in to YouTube
Sign in to YouTube
duncreg 3 months ago
Sounds like there's something wrong with the language you're using.
Sign in to YouTube
Sign in to YouTube
Tetteh Sackey 3 months ago
you still need to check the operator and new up the appropriate subclass so, how are getting rid of if statements? am i missing something?
Sign in to YouTube
Sign in to YouTube
azbiza 3 months ago
this was refreshing, ty
Sign in to YouTube
Sign in to YouTube