title
How to Code Like a Pro (with Dylan Israel)

description
Learn how to write more professional code. Learn tools and principles to improve your code from Dylan Israel. This tutorial covers: ⌨️ (0:00:00) Introduction ⌨️ (0:02:45) Linting ⌨️ (0:09:21) Variables ⌨️ (0:30:04) Functions ⌨️ (0:52:27) Comments ⌨️ (1:08:45) SOLID Principles ⌨️ (1:21:05) Single Responsibility Principle ⌨️ (1:29:52) Open Closed Principle ⌨️ (1:36:44) Liskov Substitution Principle ⌨️ (1:44:32) Interface Segregation Principle ⌨️ (1:54:49) Dependency Inversion Principle 💻Slides: https://docs.google.com/presentation/d/1KtOJz-YET9tTSdk6hiy7oehcFPAGQrBSAtfFERuBwk8/edit?usp=sharing 🔗TSLINT setup: https://www.youtube.com/watch?v=xPEMup5SPTM&t=1820 🔗ESLINT Setup: https://youtu.be/cMrDePs86Uo Check out Dylan's channel: https://www.YouTube.com/CodingTutorials360 Here is a course from Dylan you can get for $9.99: 100 Algorithm Challenge - How to Ace the JavaScript Coding Interview https://www.udemy.com/100-algorithms-challenge/?couponCode=CODINGGOD -- Learn to code for free and get a developer job: https://www.freecodecamp.org Read hundreds of articles on programming: https://medium.freecodecamp.org And subscribe for new videos on technology: https://youtube.com/subscription_center?add_user=freecodecamp

detail
{'title': 'How to Code Like a Pro (with Dylan Israel)', 'heatmap': [{'end': 944.241, 'start': 870.151, 'weight': 0.816}, {'end': 2837.07, 'start': 2750.364, 'weight': 0.707}, {'end': 4944.069, 'start': 4861.185, 'weight': 0.706}, {'end': 6325.015, 'start': 6240.198, 'weight': 0.779}, {'end': 7049.584, 'start': 6893.334, 'weight': 0.831}], 'summary': "'how to code like a pro' introduces the 'code like a pro series' focusing on clean, maintainable code, refactoring, solid principles, and software design. it emphasizes the importance of readable, organized code with examples in javascript and typescript, aiming to achieve flexible, maintainable, and quality code.", 'chapters': [{'end': 87.73, 'segs': [{'end': 45.83, 'src': 'embed', 'start': 0.269, 'weight': 0, 'content': [{'end': 7.517, 'text': "hey guys, i'm starting a new series called code like a pro, and what we're going to basically teach you is how to code professionally.", 'start': 0.269, 'duration': 7.248}, {'end': 16.887, 'text': "it's pretty apparent when you open up somebody's project and it's a hobby, or they're just starting out and they don't know how to improve their code.", 'start': 7.517, 'duration': 9.37}, {'end': 21.431, 'text': 'make it so that it looks professional, it looks readable, maintainable.', 'start': 16.887, 'duration': 4.544}, {'end': 29.938, 'text': "These are all going to be things that I've picked up as my years as a developer, but also that I can't take credit for most of them,", 'start': 21.812, 'duration': 8.126}, {'end': 37.063, 'text': "because I read books and I do courses, and I've learned these from people with many more years of experience than I have.", 'start': 29.938, 'duration': 7.125}, {'end': 45.83, 'text': 'So what does it mean to have professional code? What do I mean by that? I want to give a sort of analogy to explain it.', 'start': 37.623, 'duration': 8.207}], 'summary': "New series 'code like a pro' teaches professional coding practices for readability and maintainability.", 'duration': 45.561, 'max_score': 0.269, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE269.jpg'}, {'end': 99.862, 'src': 'embed', 'start': 66.71, 'weight': 1, 'content': [{'end': 69.672, 'text': "It's sort of like comparing a tree house to a home.", 'start': 66.71, 'duration': 2.962}, {'end': 70.973, 'text': "It's how I feel like it.", 'start': 69.753, 'duration': 1.22}, {'end': 74.176, 'text': "Like there is something that's going to last the test of time.", 'start': 71.334, 'duration': 2.842}, {'end': 79.762, 'text': "Because we have written it in such a way that it's going to be maintainable and easily updated.", 'start': 74.796, 'duration': 4.966}, {'end': 86.009, 'text': "and then you have a treehouse Which is going to slowly get worn down because we didn't build it in the proper way.", 'start': 79.762, 'duration': 6.247}, {'end': 87.73, 'text': 'Both our shelters.', 'start': 86.009, 'duration': 1.721}, {'end': 89.292, 'text': "one's going to outlast the other.", 'start': 87.73, 'duration': 1.562}, {'end': 92.035, 'text': 'so what makes? clean, maintainable code?', 'start': 89.292, 'duration': 2.743}, {'end': 99.862, 'text': "well, We're gonna be talking about a whole slew of things in this series and we're actually going to be giving specific examples, not just like hey,", 'start': 92.035, 'duration': 7.827}], 'summary': 'Comparing code to treehouses, emphasizing maintainability and longevity.', 'duration': 33.152, 'max_score': 66.71, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE66710.jpg'}], 'start': 0.269, 'title': 'Code like a pro series', 'summary': "Introduces 'code like a pro series' to teach professional coding, highlighting the significance of writing maintainable code and drawing an analogy between a tree house and a home.", 'chapters': [{'end': 87.73, 'start': 0.269, 'title': 'Code like a pro series', 'summary': 'Introduces a new series aimed at teaching professional coding, emphasizing the importance of writing maintainable and professional code, drawing an analogy between a tree house and a home.', 'duration': 87.461, 'highlights': ['The series aims to teach professional coding and emphasizes the importance of writing maintainable and professional code.', 'The speaker draws an analogy between a tree house and a home to illustrate the difference between code that is maintainable and easily updated versus code that is not built properly.', 'The speaker mentions learning from experienced individuals through books and courses to improve coding skills.', 'The importance of writing professional code is highlighted in terms of making it look professional, readable, and maintainable.']}], 'duration': 87.461, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE269.jpg', 'highlights': ['The series aims to teach professional coding and emphasizes the importance of writing maintainable and professional code.', 'The speaker draws an analogy between a tree house and a home to illustrate the difference between code that is maintainable and easily updated versus code that is not built properly.', 'The importance of writing professional code is highlighted in terms of making it look professional, readable, and maintainable.', 'The speaker mentions learning from experienced individuals through books and courses to improve coding skills.']}, {'end': 944.241, 'segs': [{'end': 161.299, 'src': 'embed', 'start': 131.524, 'weight': 0, 'content': [{'end': 133.426, 'text': "So we're going to talk about code readability.", 'start': 131.524, 'duration': 1.902}, {'end': 137.289, 'text': "You don't write code for yourself or the client even.", 'start': 133.906, 'duration': 3.383}, {'end': 140.631, 'text': "I mean you do because they're cutting the checks right.", 'start': 138.51, 'duration': 2.121}, {'end': 148.414, 'text': 'so, but the reason, the not the reason, but one of the reasons that you write code is you write it, for the next person has to maintain it right.', 'start': 140.631, 'duration': 7.783}, {'end': 156.037, 'text': 'the average dev is a job two years or something like that, and chances are that projects going to outlive you for a very long time.', 'start': 148.414, 'duration': 7.623}, {'end': 161.299, 'text': "and so you need to make sure that you're writing the cleanest code possible, the most maintainable code,", 'start': 156.037, 'duration': 5.262}], 'summary': "Code readability ensures maintainability for average dev's 2-year job and long-term project survival.", 'duration': 29.775, 'max_score': 131.524, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE131524.jpg'}, {'end': 195.906, 'src': 'embed', 'start': 171.597, 'weight': 1, 'content': [{'end': 178.619, 'text': "And these are always, whenever you're incorporating a tool, you have to answer what I call the big two, the what and the why.", 'start': 171.597, 'duration': 7.022}, {'end': 180.799, 'text': 'So what is a linter?', 'start': 179.339, 'duration': 1.46}, {'end': 189.042, 'text': 'It is a tool that you set up essentially one time, usually per project, that will flag errors, programming errors, bugs,', 'start': 181.24, 'duration': 7.802}, {'end': 191.904, 'text': 'stylistic errors and suspicious constructs.', 'start': 189.042, 'duration': 2.862}, {'end': 195.146, 'text': "What does that mean? It's basically going to catch syntax errors.", 'start': 191.944, 'duration': 3.202}, {'end': 195.906, 'text': "That's it.", 'start': 195.446, 'duration': 0.46}], 'summary': 'A linter is a tool that helps catch syntax errors and bugs in code, set up once per project, flagging errors and stylistic mistakes.', 'duration': 24.309, 'max_score': 171.597, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE171597.jpg'}, {'end': 478.073, 'src': 'embed', 'start': 448.201, 'weight': 3, 'content': [{'end': 451.953, 'text': 'Anytime you have commented code in here as well, you can go ahead and remove that.', 'start': 448.201, 'duration': 3.752}, {'end': 453.418, 'text': "There's no reason to have that.", 'start': 452.334, 'duration': 1.084}, {'end': 457.96, 'text': "So right now, we're going through the file, we're doing these minor changes.", 'start': 455.118, 'duration': 2.842}, {'end': 460.442, 'text': 'A lot of this will be syntax stuff.', 'start': 458.781, 'duration': 1.661}, {'end': 463.184, 'text': "Some of it's important, right? We're using a let instead of a const.", 'start': 460.462, 'duration': 2.722}, {'end': 465.925, 'text': "And there's hundreds of rules when it comes to this.", 'start': 463.604, 'duration': 2.321}, {'end': 469.087, 'text': "And so what you'll end up picking up are these good conventions.", 'start': 466.226, 'duration': 2.861}, {'end': 478.073, 'text': "These conventions that say, hey, what makes a good clean code? Because that's really what a linter is there for.", 'start': 469.127, 'duration': 8.946}], 'summary': 'Removing commented code, making syntax changes, emphasizing clean code conventions.', 'duration': 29.872, 'max_score': 448.201, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE448201.jpg'}, {'end': 523.823, 'src': 'embed', 'start': 493.245, 'weight': 2, 'content': [{'end': 494.946, 'text': "we'll talk about those in a later section.", 'start': 493.245, 'duration': 1.701}, {'end': 498.128, 'text': 'But we have been able to make our code much more readable,', 'start': 494.946, 'duration': 3.182}, {'end': 507.335, 'text': 'much more understandable and to the latest Standards and in terms of just basic TS lint things and linters to get going.', 'start': 498.128, 'duration': 9.207}, {'end': 512.918, 'text': 'so Linters are here to stop those syntax mistakes.', 'start': 507.335, 'duration': 5.583}, {'end': 518.981, 'text': 'Linters are here to get you to code in a certain manner, in a cleaner manner, in a more readable manner.', 'start': 513.138, 'duration': 5.843}, {'end': 523.823, 'text': 'And they are the first step to writing cleaner, more maintainable code.', 'start': 519.621, 'duration': 4.202}], 'summary': 'Using linters has improved code readability and maintainability to latest standards.', 'duration': 30.578, 'max_score': 493.245, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE493245.jpg'}, {'end': 646.907, 'src': 'embed', 'start': 621.854, 'weight': 5, 'content': [{'end': 627.797, 'text': "And then we're going to talk about what I call the, this relates to naming the variables, what I call the parent or significant other test.", 'start': 621.854, 'duration': 5.943}, {'end': 630.198, 'text': "We'll dive into that in the code examples.", 'start': 628.257, 'duration': 1.941}, {'end': 634.74, 'text': "And we're also going to talk about when we can use long names for variables and when versus short names.", 'start': 630.218, 'duration': 4.522}, {'end': 641.464, 'text': 'And, you know, some of the, you know, how we can incorporate that into our code and more.', 'start': 634.8, 'duration': 6.664}, {'end': 646.907, 'text': "Some of the and more sections we're going to talk about is the practices that a lot of people do that we need to break right?", 'start': 641.564, 'duration': 5.343}], 'summary': 'Discussion on variable naming, including the parent or significant other test, usage of long versus short names, and breaking common coding practices.', 'duration': 25.053, 'max_score': 621.854, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE621854.jpg'}, {'end': 758.335, 'src': 'embed', 'start': 727.753, 'weight': 4, 'content': [{'end': 729.774, 'text': 'The less variables, the better.', 'start': 727.753, 'duration': 2.021}, {'end': 732.676, 'text': 'And this is actually some code I wrote from like three years ago.', 'start': 730.234, 'duration': 2.442}, {'end': 739.981, 'text': "So don't think that everyone writes bad code and we all improve as long as we put the effort into.", 'start': 732.796, 'duration': 7.185}, {'end': 744.384, 'text': "But can we eliminate things? This is something that we need to start thinking about because it's rather important.", 'start': 740.261, 'duration': 4.123}, {'end': 747.546, 'text': 'And the less variables we have to maintain, the better.', 'start': 744.784, 'duration': 2.762}, {'end': 751.609, 'text': 'So in our example here, we can actually eliminate this count variable altogether.', 'start': 748.186, 'duration': 3.423}, {'end': 753.431, 'text': "There's really no reason to have it.", 'start': 751.89, 'duration': 1.541}, {'end': 758.335, 'text': "And you'll see here, okay, what are we doing with it? We're setting it to zero.", 'start': 753.951, 'duration': 4.384}], 'summary': 'Minimizing variables improves code quality and maintainability.', 'duration': 30.582, 'max_score': 727.753, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE727753.jpg'}, {'end': 944.241, 'src': 'heatmap', 'start': 870.151, 'weight': 0.816, 'content': [{'end': 875.412, 'text': 'And a better name is factorial, factorial total.', 'start': 870.151, 'duration': 5.261}, {'end': 882.254, 'text': 'Now what is this? Well, it is the number that we are storing our factorials in.', 'start': 877.051, 'duration': 5.203}, {'end': 883.715, 'text': 'Our total factorial.', 'start': 882.735, 'duration': 0.98}, {'end': 888.198, 'text': "Alright, now let's go ahead and set up here.", 'start': 884.816, 'duration': 3.382}, {'end': 890.42, 'text': 'And we can do it just like so.', 'start': 889.239, 'duration': 1.181}, {'end': 895.883, 'text': "And now, here we'll return our factorial total and not some random num that's coming in.", 'start': 890.92, 'duration': 4.963}, {'end': 899.346, 'text': "Let's give another example of some bad variable names.", 'start': 896.384, 'duration': 2.962}, {'end': 901.367, 'text': "All right, let's take a look at this function.", 'start': 900.086, 'duration': 1.281}, {'end': 903.949, 'text': "All this function's supposed to do is return today's state.", 'start': 901.487, 'duration': 2.462}, {'end': 907.032, 'text': "Now, you'll see here we have this d, and this is a very simple function.", 'start': 904.369, 'duration': 2.663}, {'end': 909.994, 'text': "But we have this d here, and we're creating it.", 'start': 907.412, 'duration': 2.582}, {'end': 916.319, 'text': "Now, if we didn't know what this was and we didn't know what this was, would we know what d is if we had a conversation?", 'start': 910.294, 'duration': 6.025}, {'end': 920.022, 'text': 'So earlier I talked about the parent or significant other test.', 'start': 916.639, 'duration': 3.383}, {'end': 928.128, 'text': "So if I said to you, baby, what do you think variable d is, what would you say? Don't be gross.", 'start': 920.502, 'duration': 7.626}, {'end': 929.787, 'text': 'Okay Okay.', 'start': 928.826, 'duration': 0.961}, {'end': 940.839, 'text': "Uh, well, what would you say if we renamed it to, I said, Hey, what do you think today's date as a variable would would be? Excellent.", 'start': 930.368, 'duration': 10.471}, {'end': 944.241, 'text': 'That is the significant other or parent test.', 'start': 941.5, 'duration': 2.741}], 'summary': 'The importance of using clear and descriptive variable names in coding is emphasized through examples and a test.', 'duration': 74.09, 'max_score': 870.151, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE870151.jpg'}], 'start': 87.73, 'title': 'Importance of clean and maintainable code', 'summary': 'Discusses the significance of clean and maintainable code, emphasizing readability, the role of linters in identifying errors, and providing coding examples to demonstrate the impact of using linters on code formatting and standards. it also explores the benefits of using linters to enforce code standards, aiming for cleaner and more maintainable code.', 'chapters': [{'end': 344.535, 'start': 87.73, 'title': 'Importance of clean and maintainable code', 'summary': 'Discusses the importance of writing clean and maintainable code, emphasizing the need for readability, the role of linters in identifying errors and improving code quality, and providing coding examples to demonstrate the impact of using linters on code formatting and standards.', 'duration': 256.805, 'highlights': ['The importance of clean and maintainable code for longevity and readability', 'Role of linters in identifying errors and improving code quality', 'Coding examples to demonstrate the impact of linters on code formatting and standards']}, {'end': 944.241, 'start': 344.816, 'title': 'Improving code readability with linters', 'summary': "Discusses the benefits of using linters to enforce code standards, including replacing 'var' with 'let' or 'const', standardizing quotes, removing commented code, and choosing descriptive variable names, ultimately aiming for cleaner and more maintainable code.", 'duration': 599.425, 'highlights': ["The chapter discusses the benefits of using linters to enforce code standards, including replacing 'var' with 'let' or 'const', standardizing quotes, removing commented code, and choosing descriptive variable names.", 'Emphasizes the significance of using descriptive variable names and eliminating unnecessary variables for improved code readability and maintenance.', "Discusses the concept of the 'parent or significant other test' for variable naming, stressing the importance of choosing names that describe the variable's purpose rather than its functionality."]}], 'duration': 856.511, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE87730.jpg', 'highlights': ['The importance of clean and maintainable code for longevity and readability', 'Role of linters in identifying errors and improving code quality', 'Coding examples to demonstrate the impact of linters on code formatting and standards', "The chapter discusses the benefits of using linters to enforce code standards, including replacing 'var' with 'let' or 'const', standardizing quotes, removing commented code, and choosing descriptive variable names", 'Emphasizes the significance of using descriptive variable names and eliminating unnecessary variables for improved code readability and maintenance', "Discusses the concept of the 'parent or significant other test' for variable naming, stressing the importance of choosing names that describe the variable's purpose rather than its functionality"]}, {'end': 1568.125, 'segs': [{'end': 975.444, 'src': 'embed', 'start': 944.581, 'weight': 2, 'content': [{'end': 949.264, 'text': 'You should be able to hand someone a piece of paper and this is the title really at the end of the day,', 'start': 944.581, 'duration': 4.683}, {'end': 951.665, 'text': 'and it should be that readable when you get going.', 'start': 949.264, 'duration': 2.401}, {'end': 953.787, 'text': "Let's go ahead and give some other examples.", 'start': 952.466, 'duration': 1.321}, {'end': 959.75, 'text': "Let's give a few more examples of how we might refactor our code in a relatively clean project,", 'start': 954.547, 'duration': 5.203}, {'end': 965.013, 'text': 'where we want to make it more readable and more understandable when it comes to our variable names.', 'start': 959.75, 'duration': 5.263}, {'end': 975.444, 'text': 'here. we have an algorithm that is going to take in some values, a double nested array for when we last backed up some items.', 'start': 965.413, 'duration': 10.031}], 'summary': 'Refactoring code for readability and understandability in a clean project with examples of improving variable names and an algorithm taking in a double nested array.', 'duration': 30.863, 'max_score': 944.581, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE944581.jpg'}, {'end': 1090.424, 'src': 'embed', 'start': 1052.516, 'weight': 0, 'content': [{'end': 1062.141, 'text': 'But in terms of short scopes of our variables, like so, this is completely fine if we wanted to shorten those a little bit.', 'start': 1052.516, 'duration': 9.625}, {'end': 1069.467, 'text': 'But one thing I would highly suggest is that you start using tools that are built into the language, where,', 'start': 1063.021, 'duration': 6.446}, {'end': 1074.971, 'text': "if you are going to iterate through an entire array, for instance, there's no reason to do a for loop like this.", 'start': 1069.467, 'duration': 5.504}, {'end': 1082.078, 'text': "We're iterating through the entire array and we have tools to make this more descriptive while still iterating through it.", 'start': 1075.572, 'duration': 6.506}, {'end': 1086.622, 'text': "So let's use a for of loop, for instance, and I'll talk about how we're going to make it more descriptive.", 'start': 1082.278, 'duration': 4.344}, {'end': 1090.424, 'text': "in our for of loop, we're gonna remove some variables,", 'start': 1087.282, 'duration': 3.142}], 'summary': 'Using built-in language tools like for of loop can make code more descriptive and efficient for iterating through arrays.', 'duration': 37.908, 'max_score': 1052.516, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1052516.jpg'}, {'end': 1379.67, 'src': 'embed', 'start': 1347.888, 'weight': 3, 'content': [{'end': 1353.95, 'text': "is they start prefixing property names with the name of the class, and it's a really bad item.", 'start': 1347.888, 'duration': 6.062}, {'end': 1358.231, 'text': "what i mean by that is say we have this cat class and is our friend's cat.", 'start': 1353.95, 'duration': 4.281}, {'end': 1362.732, 'text': "that's whose cat it is, and we want to update our friend's cat's age.", 'start': 1358.231, 'duration': 4.501}, {'end': 1364.513, 'text': 'so they just had a birthday.', 'start': 1362.732, 'duration': 1.781}, {'end': 1369.594, 'text': 'you would have the properties, which essentially are variables at the end of the day, of an object.', 'start': 1364.513, 'duration': 5.081}, {'end': 1379.67, 'text': "um, say hey, cat age is now 10 and then our friend's cat dot name.", 'start': 1370.295, 'duration': 9.375}], 'summary': 'Proposing prefixing property names with class name is not recommended.', 'duration': 31.782, 'max_score': 1347.888, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1347888.jpg'}, {'end': 1448.166, 'src': 'embed', 'start': 1418.541, 'weight': 5, 'content': [{'end': 1424.664, 'text': 'another thing to keep in mind is when you have constants, when you have variables,', 'start': 1418.541, 'duration': 6.123}, {'end': 1432.194, 'text': "Older developers although it's not too common nowadays will use what's called Hungarian notation,", 'start': 1426.169, 'duration': 6.025}, {'end': 1435.637, 'text': "where essentially you're going to include the type in your item.", 'start': 1432.194, 'duration': 3.443}, {'end': 1438.999, 'text': "So let's say we have a type here and remember our file IDs?", 'start': 1435.697, 'duration': 3.302}, {'end': 1448.166, 'text': 'So we do file IDs and then you would include number at the end or at the beginning, depending on the convention.', 'start': 1440.941, 'duration': 7.225}], 'summary': 'Older developers use hungarian notation to include type in variables.', 'duration': 29.625, 'max_score': 1418.541, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1418541.jpg'}, {'end': 1512.711, 'src': 'embed', 'start': 1486.727, 'weight': 4, 'content': [{'end': 1492.508, 'text': 'Alright, one thing that you need to avoid as well are what we call magic numbers and strings for that matter.', 'start': 1486.727, 'duration': 5.781}, {'end': 1496.609, 'text': "That's a little bit different.", 'start': 1495.849, 'duration': 0.76}, {'end': 1503.191, 'text': "Magic strings refers to passing in a key into an object that you haven't defined.", 'start': 1496.649, 'duration': 6.542}, {'end': 1512.711, 'text': 'You typically want to avoid that, but here magic numbers refers to passing in numbers that apparently came out of nowhere, with no context, right?', 'start': 1503.871, 'duration': 8.84}], 'summary': 'Avoid using magic numbers and strings to maintain code clarity and context.', 'duration': 25.984, 'max_score': 1486.727, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1486727.jpg'}], 'start': 944.581, 'title': 'Refactoring and coding best practices', 'summary': 'Covers refactoring code for readability by emphasizing the use of descriptive variable names and language tools, and also discusses coding best practices including avoiding bad coding practices that impact code clarity and maintainability.', 'chapters': [{'end': 1330.717, 'start': 944.581, 'title': 'Refactoring code for readability', 'summary': 'Emphasizes the importance of using descriptive variable names and leveraging language tools, such as array deconstruction and for of loops, to write cleaner, more readable, searchable, and maintainable code in a relatively clean project.', 'duration': 386.136, 'highlights': ['The importance of using descriptive variable names and leveraging language tools', 'Emphasizing the use of for of loops and array deconstruction for more descriptive code', 'Recommendation to change variable names for clarity and adaptability']}, {'end': 1568.125, 'start': 1330.817, 'title': 'Coding best practices', 'summary': 'Emphasizes the importance of avoiding bad coding practices such as prefixing property names with class names, using hungarian notation for variables, and utilizing magic numbers without context, highlighting the negative impact on code clarity and maintainability.', 'duration': 237.308, 'highlights': ['Avoid prefixing property names with class names as it creates clutter and confusion in code.', 'Discourage the use of Hungarian notation for variables as it adds clutter and confusion to the code.', 'Emphasize the avoidance of magic numbers without context for improved code clarity and maintainability.']}], 'duration': 623.544, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE944581.jpg', 'highlights': ['Emphasizing the use of for of loops and array deconstruction for more descriptive code', 'The importance of using descriptive variable names and leveraging language tools', 'Recommendation to change variable names for clarity and adaptability', 'Avoid prefixing property names with class names as it creates clutter and confusion in code', 'Emphasize the avoidance of magic numbers without context for improved code clarity and maintainability', 'Discourage the use of Hungarian notation for variables as it adds clutter and confusion to the code']}, {'end': 2259.416, 'segs': [{'end': 1688.889, 'src': 'embed', 'start': 1658.246, 'weight': 0, 'content': [{'end': 1661.107, 'text': 'So you typically want to avoid the global scope, if you can,', 'start': 1658.246, 'duration': 2.861}, {'end': 1666.669, 'text': 'and put variables in the most limited scope possible so that you can get that additional context.', 'start': 1661.107, 'duration': 5.562}, {'end': 1673.281, 'text': 'Another variable naming to consider is when working with booleans.', 'start': 1668.038, 'duration': 5.243}, {'end': 1681.165, 'text': 'specifically, there is a is for present tense or has for past tense in terms of the naming convention.', 'start': 1673.281, 'duration': 7.884}, {'end': 1688.889, 'text': "This sort of lets you flag it out here and we can, you know, typically we don't ever want to put the variable types in here if we can avoid it.", 'start': 1681.205, 'duration': 7.684}], 'summary': 'Avoid global scope, use limited scope for variables, consider naming conventions for booleans.', 'duration': 30.643, 'max_score': 1658.246, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1658246.jpg'}, {'end': 1794.839, 'src': 'embed', 'start': 1768.71, 'weight': 6, 'content': [{'end': 1774.077, 'text': 'The only caveat to that is that it works slightly different than our OR operator.', 'start': 1768.71, 'duration': 5.367}, {'end': 1783.909, 'text': 'So this will only assign a default value if it is actually undefined, while here it will do it for any falsity value.', 'start': 1774.117, 'duration': 9.792}, {'end': 1786.111, 'text': 'So keep that in mind.', 'start': 1784.81, 'duration': 1.301}, {'end': 1794.839, 'text': "but in general you want to, unless you have a good reason, want to put it in your default parameters, because it's in one location,", 'start': 1786.111, 'duration': 8.728}], 'summary': 'Use default parameters for any falsity value, but not for undefined.', 'duration': 26.129, 'max_score': 1768.71, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1768710.jpg'}, {'end': 1908.406, 'src': 'embed', 'start': 1880.963, 'weight': 1, 'content': [{'end': 1886.307, 'text': "We're going to go over about three or four things that we can do to name our functions properly and give some examples.", 'start': 1880.963, 'duration': 5.344}, {'end': 1892.312, 'text': "We're gonna talk about limiting parameters and how we might go about doing that and why we need to do that.", 'start': 1887.108, 'duration': 5.204}, {'end': 1896.856, 'text': "We're gonna of course talk about the DRY principle, which hopefully everyone's familiar with.", 'start': 1892.453, 'duration': 4.403}, {'end': 1899.098, 'text': "Don't repeat yourself and why that's so important.", 'start': 1896.956, 'duration': 2.142}, {'end': 1904.463, 'text': "We're gonna talk about avoiding side effects in our code to the best of our ability.", 'start': 1900.119, 'duration': 4.344}, {'end': 1908.406, 'text': "and we're going to be talking about why there should never be global functions.", 'start': 1905.223, 'duration': 3.183}], 'summary': 'Discussing naming, parameters, dry principle, side effects, and global functions.', 'duration': 27.443, 'max_score': 1880.963, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1880963.jpg'}, {'end': 2039.279, 'src': 'embed', 'start': 2010.807, 'weight': 4, 'content': [{'end': 2016.75, 'text': "I think that's fine because that's as descriptive as we could probably get.", 'start': 2010.807, 'duration': 5.943}, {'end': 2019.371, 'text': 'This is TypeScript.', 'start': 2016.77, 'duration': 2.601}, {'end': 2022.793, 'text': "In JavaScript, typically, you don't have return types.", 'start': 2019.871, 'duration': 2.922}, {'end': 2027.555, 'text': 'This is a personal preference, I will say, what I think makes more maintainable code.', 'start': 2023.093, 'duration': 4.462}, {'end': 2031.236, 'text': 'is when we actually put explicit return types.', 'start': 2028.215, 'duration': 3.021}, {'end': 2039.279, 'text': "TypeScript is optional and in JavaScript it doesn't exist, but in most languages you have the ability to add an explicit return type,", 'start': 2031.776, 'duration': 7.503}], 'summary': 'Typescript promotes explicit return types for maintainable code.', 'duration': 28.472, 'max_score': 2010.807, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2010807.jpg'}, {'end': 2204.281, 'src': 'embed', 'start': 2173.58, 'weight': 3, 'content': [{'end': 2177.103, 'text': "So we've now put all the logic in two separate files.", 'start': 2173.58, 'duration': 3.523}, {'end': 2179.964, 'text': "And we're saying at the end of here, reset.", 'start': 2177.583, 'duration': 2.381}, {'end': 2190.831, 'text': "So we have this.borderbox and our else and we've sort of put these into smaller functions.", 'start': 2182.306, 'duration': 8.525}, {'end': 2191.771, 'text': "That's really one of the things.", 'start': 2190.871, 'duration': 0.9}, {'end': 2198.315, 'text': 'If your function is more than 10 lines long, you need to start reconsidering how we might be able to,', 'start': 2192.011, 'duration': 6.304}, {'end': 2204.281, 'text': 'how we might be able to go about and refactor that.', 'start': 2200.12, 'duration': 4.161}], 'summary': 'Logic is separated into two files, functions should be less than 10 lines long.', 'duration': 30.701, 'max_score': 2173.58, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2173580.jpg'}], 'start': 1570.026, 'title': 'Code refactoring best practices', 'summary': 'Discusses best practices for code refactoring, emphasizing readable and maintainable code, avoiding global variables, scoping variables, naming conventions for booleans and default parameters, objectives for functions, and principles like dry and avoiding side effects. it also emphasizes consistent and descriptive verb-based variable names, refactoring functions into smaller, more readable ones, and adding explicit return types for maintainable and testable code.', 'chapters': [{'end': 1917.313, 'start': 1570.026, 'title': 'Code refactoring best practices', 'summary': 'Discusses the best practices for code refactoring, including the importance of readable and maintainable code, avoiding global variables, scoping variables, naming conventions for booleans and default parameters, objectives for functions, and principles like dry and avoiding side effects.', 'duration': 347.287, 'highlights': ['The importance of readable and maintainable code is emphasized, highlighting the need to avoid global variables, scope variables to limited scopes, use appropriate naming conventions for booleans and default parameters, and follow best practices for writing functions.', 'The need to avoid global variables is stressed, with the suggestion to scope variables to limited scopes to provide contextual usefulness.', "The chapter discusses naming conventions for booleans, emphasizing the use of 'is' for present tense and 'has' for past tense, and the importance of keeping variable names singular, readable, and pronounceable.", 'The importance of default parameters is highlighted, suggesting to use default values for parameters and to avoid the OR operator, as it only assigns a default value if it is actually undefined, while default parameters work for any falsity value.', 'The objectives for functions are outlined as writing smaller functions, ensuring they read top to bottom, correct function naming, limiting parameters, following the DRY principle, and avoiding side effects and global functions.']}, {'end': 2259.416, 'start': 1917.813, 'title': 'Naming conventions and function refactoring', 'summary': 'Emphasizes the importance of using consistent and descriptive verb-based variable names, refactoring functions into smaller, more readable ones, and adding explicit return types for maintainable and testable code.', 'duration': 341.603, 'highlights': ['The chapter stresses the importance of using consistent and descriptive verb-based variable names to improve code readability and maintainability.', 'Refactoring functions into smaller, more descriptive ones is recommended, with the suggestion to keep functions under 10 lines long for better maintainability.', 'Adding explicit return types is advised for more maintainable and testable code.']}], 'duration': 689.39, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE1570026.jpg', 'highlights': ['The importance of readable and maintainable code is emphasized, highlighting the need to avoid global variables, scope variables to limited scopes, use appropriate naming conventions for booleans and default parameters, and follow best practices for writing functions.', 'The objectives for functions are outlined as writing smaller functions, ensuring they read top to bottom, correct function naming, limiting parameters, following the DRY principle, and avoiding side effects and global functions.', "The chapter discusses naming conventions for booleans, emphasizing the use of 'is' for present tense and 'has' for past tense, and the importance of keeping variable names singular, readable, and pronounceable.", 'Refactoring functions into smaller, more descriptive ones is recommended, with the suggestion to keep functions under 10 lines long for better maintainability.', 'Adding explicit return types is advised for more maintainable and testable code.', 'The need to avoid global variables is stressed, with the suggestion to scope variables to limited scopes to provide contextual usefulness.', 'The importance of default parameters is highlighted, suggesting to use default values for parameters and to avoid the OR operator, as it only assigns a default value if it is actually undefined, while default parameters work for any falsity value.', 'The chapter stresses the importance of using consistent and descriptive verb-based variable names to improve code readability and maintainability.']}, {'end': 2734.356, 'segs': [{'end': 2314.04, 'src': 'embed', 'start': 2279.354, 'weight': 1, 'content': [{'end': 2288.598, 'text': 'Okay, so this would be a great example of how we might might modify a name here.', 'start': 2279.354, 'duration': 9.244}, {'end': 2299.248, 'text': "so we have this add points where we're incrementing points and you can make the argument that perhaps what we're actually doing here is updating the points.", 'start': 2288.598, 'duration': 10.65}, {'end': 2306.796, 'text': 'add is a little bit more descriptive, but update, update points by one by.', 'start': 2299.248, 'duration': 7.548}, {'end': 2314.04, 'text': "So this is a unique one, because it looks like we're always incrementing.", 'start': 2308.935, 'duration': 5.105}], 'summary': 'A discussion about modifying and updating points, potentially incrementing by one.', 'duration': 34.686, 'max_score': 2279.354, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2279354.jpg'}, {'end': 2369.261, 'src': 'embed', 'start': 2333.436, 'weight': 5, 'content': [{'end': 2336.058, 'text': 'You want to separate blocks of code based off spaces.', 'start': 2333.436, 'duration': 2.622}, {'end': 2340.562, 'text': "Let's see here.", 'start': 2339.522, 'duration': 1.04}, {'end': 2344.924, 'text': 'So this is probably a name that we would refactor very quickly.', 'start': 2341.123, 'duration': 3.801}, {'end': 2349.766, 'text': "And the reason for it is great job isn't descriptive, right? It doesn't really provide any context.", 'start': 2344.944, 'duration': 4.822}, {'end': 2356.833, 'text': 'It is sort of a funny name in the fact that like, oh, great job.', 'start': 2352.37, 'duration': 4.463}, {'end': 2364.478, 'text': 'What is this actually? Probably a completion animation.', 'start': 2357.573, 'duration': 6.905}, {'end': 2369.261, 'text': 'This would be something like trigger.', 'start': 2366.139, 'duration': 3.122}], 'summary': "Refactor code to improve descriptiveness and context, such as changing 'great job' to a more specific name like 'completion animation.'", 'duration': 35.825, 'max_score': 2333.436, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2333436.jpg'}, {'end': 2460.655, 'src': 'embed', 'start': 2429.853, 'weight': 4, 'content': [{'end': 2437.597, 'text': 'So I definitely would change this to update styles, because we are trying to do one concept, one verb per concept, right?', 'start': 2429.853, 'duration': 7.744}, {'end': 2442.06, 'text': 'And you also notice that a good job was not a verb as well.', 'start': 2438.998, 'duration': 3.062}, {'end': 2444.595, 'text': 'functions and methods.', 'start': 2443.473, 'duration': 1.122}, {'end': 2448.7, 'text': 'these are verbs and we need to treat them as such right.', 'start': 2444.595, 'duration': 4.105}, {'end': 2453.226, 'text': "so I'm not really take so.", 'start': 2448.7, 'duration': 4.526}, {'end': 2460.655, 'text': "here we're going to do update CSS display again, because we are updating a ton of different values here.", 'start': 2453.226, 'duration': 7.429}], 'summary': 'Update styles to reflect one verb per concept, such as functions and methods as verbs.', 'duration': 30.802, 'max_score': 2429.853, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2429853.jpg'}, {'end': 2576.228, 'src': 'embed', 'start': 2545.012, 'weight': 0, 'content': [{'end': 2550.257, 'text': "So I'm going to and notice, by the way, how, when I'm writing these additional functions, that we're going to break out our code.", 'start': 2545.012, 'duration': 5.245}, {'end': 2551.338, 'text': "it's always right next to it.", 'start': 2550.257, 'duration': 1.081}, {'end': 2558.604, 'text': "It's. it's by convenience, but it's also by design, where we want functions that are used by other functions, if possible,", 'start': 2551.858, 'duration': 6.746}, {'end': 2561.867, 'text': 'to be nested in the code where you would expect them to be.', 'start': 2558.604, 'duration': 3.263}, {'end': 2564.169, 'text': "Right So I'm defining a function that I'm going to use here.", 'start': 2561.927, 'duration': 2.242}, {'end': 2567.192, 'text': 'Um, and I want that.', 'start': 2565.59, 'duration': 1.602}, {'end': 2576.228, 'text': 'I want it to, um, I want it to be nearby so I can see it and provide context.', 'start': 2567.312, 'duration': 8.916}], 'summary': 'Code functions are nested for convenience and design.', 'duration': 31.216, 'max_score': 2545.012, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2545012.jpg'}], 'start': 2259.416, 'title': 'Code refactoring and css updates', 'summary': 'Covers the significance of descriptive naming and functionality in code, emphasizing the need for clear and meaningful names to improve readability and maintainability. it also discusses updating css display and functions, emphasizing the use of descriptive variable names and nesting functions for clarity, and removing unnecessary code for efficient function organization.', 'chapters': [{'end': 2429.492, 'start': 2259.416, 'title': 'Refactoring code naming and functionality', 'summary': 'Discusses the importance of descriptive naming and functionality in code, highlighting the need for clear and meaningful names to improve readability and maintainability, and the significance of separating code blocks for better organization.', 'duration': 170.076, 'highlights': ["Descriptive naming and functionality are crucial for code readability and maintainability, emphasizing the need for clear and meaningful names (e.g., 'update points' instead of 'add points') and the significance of organizing code blocks with proper formatting.", "Using descriptive names like 'update points' instead of 'add points' contributes to better code understanding and maintainability, while also highlighting the importance of choosing names that provide clear context and functionality (e.g., 'trigger completion animation' instead of 'great job').", 'Organizing code blocks with proper formatting, such as separating them based on spaces, is essential for better code organization and readability, emphasizing the significance of structuring code for improved maintainability and understanding.', "Refactoring code names, such as 'great job' to 'trigger completion animation,' contributes to improved code understanding and context, highlighting the importance of choosing names that clearly represent the functionality and purpose of the code."]}, {'end': 2734.356, 'start': 2429.853, 'title': 'Updating css display and functions', 'summary': 'Discusses updating css display and functions, emphasizing the use of descriptive variable names and nesting functions for clarity, and removing unnecessary code for efficient function organization.', 'duration': 304.503, 'highlights': ['The chapter emphasizes the importance of using descriptive variable names and nesting functions for clarity and context, advocating for longer variable names if necessary.', 'The speaker discusses the process of updating CSS display and functions, highlighting the need to remove unnecessary code for efficient function organization.', 'The chapter addresses the concept of updating CSS display and functions, emphasizing the importance of one verb per concept and the need to treat functions and methods as verbs.']}], 'duration': 474.94, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2259416.jpg', 'highlights': ['Descriptive naming and functionality are crucial for code readability and maintainability', "Using descriptive names like 'update points' instead of 'add points' contributes to better code understanding", 'Organizing code blocks with proper formatting is essential for better code organization and readability', 'The chapter emphasizes the importance of using descriptive variable names and nesting functions for clarity and context', 'The speaker discusses the process of updating CSS display and functions, highlighting the need to remove unnecessary code for efficient function organization', "Refactoring code names, such as 'great job' to 'trigger completion animation,' contributes to improved code understanding and context"]}, {'end': 4046.259, 'segs': [{'end': 2837.07, 'src': 'heatmap', 'start': 2735.316, 'weight': 0, 'content': [{'end': 2738.277, 'text': 'One other thing we talked about was eliminating Boolean flags.', 'start': 2735.316, 'duration': 2.961}, {'end': 2742.118, 'text': "And that's sort of what I meant with this if else, because that's really what it is.", 'start': 2738.477, 'duration': 3.641}, {'end': 2745.42, 'text': 'I mean, typically a Boolean flag would be passed in here.', 'start': 2742.138, 'duration': 3.282}, {'end': 2750.364, 'text': 'In our application.', 'start': 2748.323, 'duration': 2.041}, {'end': 2760.708, 'text': 'one thing that we could do is we could probably eliminate this function altogether and just do our best to have these trigger the correct code.', 'start': 2750.364, 'duration': 10.344}, {'end': 2765.01, 'text': "And we could go ahead and throw reset into each one of these when they're called.", 'start': 2760.728, 'duration': 4.282}, {'end': 2773.754, 'text': 'and we can just say hey, we need to make sure that this is only on the one with the ID of border box,', 'start': 2766.867, 'duration': 6.887}, {'end': 2776.697, 'text': "and now we don't have to have this sort of boolean flag,", 'start': 2773.754, 'duration': 2.943}, {'end': 2784.324, 'text': 'this if-else that goes in there or a flag that goes into the event or the parameter or anything like that.', 'start': 2776.697, 'duration': 7.627}, {'end': 2791.17, 'text': "So typically, if you can, and it's not always possible, but it's possible more often than people think, it's great to.", 'start': 2784.804, 'duration': 6.366}, {'end': 2800.101, 'text': "to try and eliminate those boolean flags so that you don't have to worry about them.", 'start': 2793.496, 'duration': 6.605}, {'end': 2808.186, 'text': 'Now, somehow this is not, I mean, I think I talked about it when it comes to variables about not having globals.', 'start': 2801.602, 'duration': 6.584}, {'end': 2820.495, 'text': "But so in this project, we have this CSS here, which is, you know, we don't even really do anything with it.", 'start': 2810.048, 'duration': 10.447}, {'end': 2821.516, 'text': 'We just initialize it.', 'start': 2820.535, 'duration': 0.981}, {'end': 2828.727, 'text': "We want to do our best to not have globals and there's quite a bit of globals in here.", 'start': 2823.226, 'duration': 5.501}, {'end': 2837.07, 'text': 'And the reason for that is, um, even an object oriented program, we want to have as few side effects as possible.', 'start': 2828.747, 'duration': 8.323}], 'summary': 'Suggests eliminating boolean flags and reducing global variables to minimize side effects in programming.', 'duration': 72.87, 'max_score': 2735.316, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2735316.jpg'}, {'end': 2912.594, 'src': 'embed', 'start': 2861.429, 'weight': 2, 'content': [{'end': 2874.247, 'text': "where let's just eliminate this variable altogether and and in here we are going to get the width, the padding, the margin,", 'start': 2861.429, 'duration': 12.818}, {'end': 2889.734, 'text': 'and so we can eliminate this global variable by writing a function where we say something git, css, box, model properties,', 'start': 2874.247, 'duration': 15.487}, {'end': 2912.594, 'text': "and in here we will go ahead and take all this and put this in here, and what we're gonna return is just an array of those values.", 'start': 2889.734, 'duration': 22.86}], 'summary': 'Eliminate global variable by writing a function to retrieve width, padding, and margin as an array.', 'duration': 51.165, 'max_score': 2861.429, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2861429.jpg'}, {'end': 3186.629, 'src': 'embed', 'start': 3163.358, 'weight': 5, 'content': [{'end': 3172.182, 'text': "So we're going to be talking about what are good comments, what are bad comments and how we can know if it's worth having one,", 'start': 3163.358, 'duration': 8.824}, {'end': 3176.744, 'text': 'what are some of the downsides of having them and how we can, for the most part, remove comments and why.', 'start': 3172.182, 'duration': 4.562}, {'end': 3182.827, 'text': "So the very first aspect that we're going to be talking about are what makes comments bad.", 'start': 3177.104, 'duration': 5.723}, {'end': 3183.807, 'text': 'This is just two points.', 'start': 3182.867, 'duration': 0.94}, {'end': 3186.629, 'text': "There's a lot of other things, but this is the first example we're going to get.", 'start': 3183.847, 'duration': 2.782}], 'summary': 'Discussing good and bad comments, their downsides, and the process of removing them.', 'duration': 23.271, 'max_score': 3163.358, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE3163358.jpg'}, {'end': 3692.866, 'src': 'embed', 'start': 3660.766, 'weight': 6, 'content': [{'end': 3666.591, 'text': 'So these sort of visual cues, visual markers, there is absolutely no reason to have it in your application.', 'start': 3660.766, 'duration': 5.825}, {'end': 3674.323, 'text': "The last sort of item I want to sort of caution you when it comes to comments are to do's.", 'start': 3667.612, 'duration': 6.711}, {'end': 3682.255, 'text': "So if you're not familiar with to do's, to do's are something devs like to do where they like to.", 'start': 3674.343, 'duration': 7.912}, {'end': 3692.866, 'text': "I'm trying to think of a different word than do, but they like to do to do's to say hey, go back and add this feature, expand upon this, remove this,", 'start': 3683.817, 'duration': 9.049}], 'summary': "Avoid visual cues in applications. caution on using to do's for feature requests.", 'duration': 32.1, 'max_score': 3660.766, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE3660766.jpg'}, {'end': 3784.939, 'src': 'embed', 'start': 3745.708, 'weight': 4, 'content': [{'end': 3755.354, 'text': 'we could eliminate the need for comments because comments are really there when we have failed to name our functions and our variables properly and in our code to be descriptive.', 'start': 3745.708, 'duration': 9.646}, {'end': 3757.035, 'text': 'right, we want the code.', 'start': 3755.354, 'duration': 1.681}, {'end': 3763.079, 'text': "we want to better structure our code so that we can tell what's going on in the code without having to leave the comment.", 'start': 3757.035, 'duration': 6.044}, {'end': 3764.179, 'text': "that's our objective here.", 'start': 3763.079, 'duration': 1.1}, {'end': 3767.762, 'text': "we're gonna write better code where comments are not needed.", 'start': 3764.179, 'duration': 3.583}, {'end': 3775.47, 'text': "now there are some times where comments are especially needed and and we're going to give some examples of what those might be.", 'start': 3767.762, 'duration': 7.708}, {'end': 3781.517, 'text': "So let's talk about the characteristic of some good comments and some comments that we have to have.", 'start': 3776.653, 'duration': 4.864}, {'end': 3784.939, 'text': 'So the first thing is that it needs to be short and concise.', 'start': 3781.997, 'duration': 2.942}], 'summary': 'Objective: write descriptive code to eliminate need for comments.', 'duration': 39.231, 'max_score': 3745.708, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE3745708.jpg'}], 'start': 2735.316, 'title': 'Code optimization techniques', 'summary': 'Discusses eliminating boolean flags and global variables, improving code comments, and avoiding bad comments, potentially streamlining processes and enhancing functionality, with a focus on specific triggers and code clarity.', 'chapters': [{'end': 2784.324, 'start': 2735.316, 'title': 'Eliminating boolean flags in code', 'summary': 'Discusses the elimination of boolean flags in the code, suggesting the elimination of certain functions and the use of specific triggers to streamline the process, potentially reducing the need for if-else statements and flags in the parameters.', 'duration': 49.008, 'highlights': ['The suggestion to eliminate certain functions and use triggers could have a significant impact on streamlining the code and potentially reducing the need for if-else statements and flags in the parameters.', 'The concept of throwing reset into each trigger when called could simplify the code and enhance its efficiency by avoiding the use of boolean flags.']}, {'end': 3146.971, 'start': 2784.804, 'title': 'Eliminating global variables in css', 'summary': "Emphasizes the importance of eliminating global variables and side effects in order to improve the application's functionality, highlighting the process of replacing global variables with a function to return specific css properties.", 'duration': 362.167, 'highlights': ['Replacing global variables with a function to return specific CSS properties', 'Emphasizing the importance of eliminating global variables and side effects', 'Addressing the need to avoid side effects in the entire application']}, {'end': 3660.465, 'start': 3147.011, 'title': 'Understanding and improving code comments', 'summary': 'Discusses the importance of good comments, the downsides of unnecessary comments, and provides examples of eliminating bad comments, emphasizing the need for descriptive code and the removal of unnecessary comments, with a focus on misleading and leftover code comments.', 'duration': 513.454, 'highlights': ['The chapter emphasizes the need for descriptive code and the removal of unnecessary comments, with a focus on misleading and leftover code comments.', 'The downsides of unnecessary comments are discussed, with examples provided on how to eliminate bad comments.', 'The importance of good comments is emphasized, highlighting the need for clear and descriptive code.']}, {'end': 4046.259, 'start': 3660.766, 'title': 'Avoiding bad comments in code', 'summary': "Highlights the importance of avoiding bad comments in code, such as to do's and unnecessary visual cues, and emphasizes the need for clear, concise, and value-providing comments, including examples of good comments and their business purposes.", 'duration': 385.493, 'highlights': ["The chapter highlights the importance of avoiding bad comments in code, such as to do's and unnecessary visual cues.", 'Emphasizes the need for clear, concise, and value-providing comments.', 'Provides examples of good comments and their business purposes.']}], 'duration': 1310.943, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE2735316.jpg', 'highlights': ['The suggestion to eliminate certain functions and use triggers could have a significant impact on streamlining the code and potentially reducing the need for if-else statements and flags in the parameters.', 'The concept of throwing reset into each trigger when called could simplify the code and enhance its efficiency by avoiding the use of boolean flags.', 'Replacing global variables with a function to return specific CSS properties', 'Emphasizing the importance of eliminating global variables and side effects', 'The chapter emphasizes the need for descriptive code and the removal of unnecessary comments, with a focus on misleading and leftover code comments.', 'The downsides of unnecessary comments are discussed, with examples provided on how to eliminate bad comments.', "The chapter highlights the importance of avoiding bad comments in code, such as to do's and unnecessary visual cues.", 'The importance of good comments is emphasized, highlighting the need for clear and descriptive code.']}, {'end': 4951.854, 'segs': [{'end': 4107.417, 'src': 'embed', 'start': 4063.747, 'weight': 2, 'content': [{'end': 4069.129, 'text': 'but short and concise provides value of some sort, telling you what it is, and then legal comments.', 'start': 4063.747, 'duration': 5.382}, {'end': 4073.211, 'text': "Now, by the end of this, you've probably said hey, man, so we don't leave comments anymore.", 'start': 4069.529, 'duration': 3.682}, {'end': 4074.392, 'text': "That's a good thing.", 'start': 4073.512, 'duration': 0.88}, {'end': 4076.233, 'text': "That's another thing we don't have to maintain.", 'start': 4074.492, 'duration': 1.741}, {'end': 4081.737, 'text': 'Our unit tests are going to be our form of documentation to explain how our application evolves.', 'start': 4076.353, 'duration': 5.384}, {'end': 4090.122, 'text': "Our code structure should be clean and concise and follow standards and there's no reason for those blocks of codes.", 'start': 4082.117, 'duration': 8.005}, {'end': 4092.604, 'text': 'Comments for what a function does or a variable is.', 'start': 4090.483, 'duration': 2.121}, {'end': 4098.249, 'text': 'should be far and few between,', 'start': 4093.204, 'duration': 5.045}, {'end': 4107.417, 'text': "because we're going to name our variables properly and we're going to name our functions properly so that they're descriptive and show us what our code is doing,", 'start': 4098.249, 'duration': 9.168}], 'summary': 'Encourages minimal comments, relies on unit tests for documentation, and emphasizes clean code structure and naming conventions.', 'duration': 43.67, 'max_score': 4063.747, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4063747.jpg'}, {'end': 4157.542, 'src': 'embed', 'start': 4130.439, 'weight': 0, 'content': [{'end': 4135.345, 'text': 'So what are the SOLID principles? Well, as I mentioned, it is an acronym.', 'start': 4130.439, 'duration': 4.906}, {'end': 4139.828, 'text': 'And the S stands for the single responsibility principle.', 'start': 4136.526, 'duration': 3.302}, {'end': 4142.951, 'text': 'The O is for the open-close principle.', 'start': 4140.309, 'duration': 2.642}, {'end': 4147.295, 'text': 'The L is the Liskov substitution principle.', 'start': 4143.572, 'duration': 3.723}, {'end': 4153.92, 'text': 'The I, which is one of my more favorite principles of the solid principles, is the interface segregation principle.', 'start': 4147.694, 'duration': 6.226}, {'end': 4157.542, 'text': 'And finally, we have the dependency inversion principle.', 'start': 4153.96, 'duration': 3.582}], 'summary': 'Explaining solid principles: s stands for single responsibility, o for open-close, l for liskov substitution, i for interface segregation, and d for dependency inversion.', 'duration': 27.103, 'max_score': 4130.439, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4130439.jpg'}, {'end': 4249.169, 'src': 'embed', 'start': 4222.117, 'weight': 1, 'content': [{'end': 4227.439, 'text': 'The solid principles are there are ways for us to write our code and deliver some things.', 'start': 4222.117, 'duration': 5.322}, {'end': 4236.503, 'text': "And we're going to talk about why we should write our code in such ways so that they support certain development practices.", 'start': 4227.499, 'duration': 9.004}, {'end': 4240.185, 'text': "Now, he's also the co-author of the Agile Manifesto.", 'start': 4237.063, 'duration': 3.122}, {'end': 4249.169, 'text': "And you might be saying, well, why is that relevant? Well, because that's part of the SOLID Principles goals.", 'start': 4241.025, 'duration': 8.144}], 'summary': 'The solid principles guide code writing and support development practices, linked to the agile manifesto.', 'duration': 27.052, 'max_score': 4222.117, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4222117.jpg'}, {'end': 4384.21, 'src': 'embed', 'start': 4347.762, 'weight': 4, 'content': [{'end': 4352.923, 'text': 'So why does it help us do that? Well, it helped us accomplish a couple of things.', 'start': 4347.762, 'duration': 5.161}, {'end': 4356.564, 'text': 'It helps our code to be more understandable or readable.', 'start': 4352.943, 'duration': 3.621}, {'end': 4361.845, 'text': 'It helps it to be easier to maintain and it allows it to be flexible.', 'start': 4357.064, 'duration': 4.781}, {'end': 4368.927, 'text': 'So the strengths of the solid principles is it abstracts some things.', 'start': 4361.945, 'duration': 6.982}, {'end': 4371.347, 'text': 'So when changes happen,', 'start': 4369.707, 'duration': 1.64}, {'end': 4384.21, 'text': "it's much more flexible to get them to work and It allows us to extend things instead of breaking things and having to rewrite things.", 'start': 4371.347, 'duration': 12.863}], 'summary': 'Applying solid principles improves code readability, maintainability, and flexibility, enabling easier extension and adaptation to changes.', 'duration': 36.448, 'max_score': 4347.762, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4347762.jpg'}, {'end': 4555.35, 'src': 'embed', 'start': 4526.326, 'weight': 6, 'content': [{'end': 4529.588, 'text': 'These are what we are trying to follow in a perfect world.', 'start': 4526.326, 'duration': 3.262}, {'end': 4535.321, 'text': 'Another item about this is you want to be able to?', 'start': 4531.519, 'duration': 3.802}, {'end': 4544.324, 'text': "if you're following proper inheritance, you should be able to swap in different versions of different services and items like that.", 'start': 4535.321, 'duration': 9.003}, {'end': 4555.35, 'text': 'So you can extend maybe an interface that will go into in for your service or items like that, and the open close principles refers to that.', 'start': 4544.364, 'duration': 10.986}], 'summary': 'Following proper inheritance allows swapping in different versions of services and items, adhering to open close principles.', 'duration': 29.024, 'max_score': 4526.326, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4526326.jpg'}, {'end': 4733.62, 'src': 'embed', 'start': 4707.928, 'weight': 7, 'content': [{'end': 4715.69, 'text': "And so that's what the Liskov substitution principle, derived classes, you must be able to substitute them for their base level classes.", 'start': 4707.928, 'duration': 7.762}, {'end': 4722.292, 'text': 'So the interface segregation principle, one of my favorite principles.', 'start': 4717.168, 'duration': 5.124}, {'end': 4728.276, 'text': 'I like a lot of them, but the clients should not be forced to depend on methods that they do not use.', 'start': 4722.292, 'duration': 5.984}, {'end': 4731.779, 'text': 'At first glance this quote.', 'start': 4730.218, 'duration': 1.561}, {'end': 4733.62, 'text': 'I probably could have chosen a better quote,', 'start': 4731.779, 'duration': 1.841}], 'summary': 'Liskov substitution principle: derived classes should substitute base level classes. interface segregation principle: clients should not be forced to depend on unused methods.', 'duration': 25.692, 'max_score': 4707.928, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4707928.jpg'}, {'end': 4855.94, 'src': 'embed', 'start': 4803.854, 'weight': 8, 'content': [{'end': 4806.855, 'text': 'One, that you should have a layer of abstraction.', 'start': 4803.854, 'duration': 3.001}, {'end': 4815.22, 'text': "And two, that you shouldn't force people to use things that then makes it so tightly coupled that you can't override it.", 'start': 4807.676, 'duration': 7.544}, {'end': 4818.122, 'text': "And that's the idea here with the interface segregation principle.", 'start': 4815.26, 'duration': 2.862}, {'end': 4823.593, 'text': "Now if you haven't noticed by now, I've said the word abstraction about 15 times.", 'start': 4818.991, 'duration': 4.602}, {'end': 4829.155, 'text': 'And in the dependency inversion principle, that will continue on.', 'start': 4824.713, 'duration': 4.442}, {'end': 4835.238, 'text': 'So high level modules should not depend on low level modules, both should depend upon abstractions.', 'start': 4829.716, 'duration': 5.522}, {'end': 4842.241, 'text': 'This goes back to depending on, not necessarily interfaces, although you will, but abstractions.', 'start': 4835.758, 'duration': 6.483}, {'end': 4855.94, 'text': 'Instead of having your actual code depend on other aspects of your code, what you want are to have those abstraction layers that you code in there.', 'start': 4844.128, 'duration': 11.812}], 'summary': 'Emphasize abstraction and dependency inversion principle for decoupling modules and code reuse.', 'duration': 52.086, 'max_score': 4803.854, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4803854.jpg'}, {'end': 4944.069, 'src': 'heatmap', 'start': 4861.185, 'weight': 0.706, 'content': [{'end': 4864.869, 'text': 'And so the dependency inversion principle helps support that as well.', 'start': 4861.185, 'duration': 3.684}, {'end': 4873.054, 'text': "Today we're gonna be talking about the first letter of the SOLID acronym, the S, the Single Responsibility Principle.", 'start': 4865.129, 'duration': 7.925}, {'end': 4875.195, 'text': 'I will be your host as always, Dylan Israel.', 'start': 4873.514, 'duration': 1.681}, {'end': 4881.179, 'text': 'So what exactly is the idea behind the Single Responsibility Principle??', 'start': 4875.215, 'duration': 5.964}, {'end': 4886.263, 'text': 'Well, it states that every software module should have one and only one reason to change.', 'start': 4881.52, 'duration': 4.743}, {'end': 4889.705, 'text': 'Now, what does that actually mean?', 'start': 4887.043, 'duration': 2.662}, {'end': 4896.618, 'text': "It means that we're gonna have smaller classes, we're gonna have single responsibility classes,", 'start': 4890.953, 'duration': 5.665}, {'end': 4902.723, 'text': 'and this is gonna allow us to limit the impact of change.', 'start': 4896.618, 'duration': 6.105}, {'end': 4913.351, 'text': 'What does this actually mean? This is a quote from Uncle Bob, who is a very big proponent of the solid principles, essentially the creator.', 'start': 4903.323, 'duration': 10.028}, {'end': 4920.036, 'text': 'Gather together the things that change for the same reason, separate those things that change for a different reason.', 'start': 4913.852, 'duration': 6.184}, {'end': 4929.031, 'text': "So what I take that to mean is we're going to have cohesion where it matters and we're going to decouple our code where it doesn't matter.", 'start': 4920.837, 'duration': 8.194}, {'end': 4942.128, 'text': "Now most people focus only on making things as small as a as possible to automatize things to such a degree, because that's more so the issue more so.", 'start': 4929.452, 'duration': 12.676}, {'end': 4944.069, 'text': 'people have things that are just too big.', 'start': 4942.128, 'duration': 1.941}], 'summary': 'Single responsibility principle: every software module should have one reason to change, leading to smaller, more focused classes and reduced impact of change.', 'duration': 82.884, 'max_score': 4861.185, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4861185.jpg'}, {'end': 4902.723, 'src': 'embed', 'start': 4875.215, 'weight': 5, 'content': [{'end': 4881.179, 'text': 'So what exactly is the idea behind the Single Responsibility Principle??', 'start': 4875.215, 'duration': 5.964}, {'end': 4886.263, 'text': 'Well, it states that every software module should have one and only one reason to change.', 'start': 4881.52, 'duration': 4.743}, {'end': 4889.705, 'text': 'Now, what does that actually mean?', 'start': 4887.043, 'duration': 2.662}, {'end': 4896.618, 'text': "It means that we're gonna have smaller classes, we're gonna have single responsibility classes,", 'start': 4890.953, 'duration': 5.665}, {'end': 4902.723, 'text': 'and this is gonna allow us to limit the impact of change.', 'start': 4896.618, 'duration': 6.105}], 'summary': 'Single responsibility principle: each module should have one reason to change, leading to smaller classes and limited change impact.', 'duration': 27.508, 'max_score': 4875.215, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4875215.jpg'}], 'start': 4046.259, 'title': 'Importance of solid principles in code', 'summary': "Emphasizes the significance of adhering to the five solid principles - single responsibility, open-close, liskov substitution, interface segregation, and dependency inversion, aiming to achieve clean and concise code structure with minimal comments. it also discusses uncle bob's introduction of solid principles, aiming to support development practices and agile methodologies for more understandable, maintainable, and flexible code.", 'chapters': [{'end': 4181.149, 'start': 4046.259, 'title': 'Importance of solid principles in code', 'summary': 'Emphasizes the importance of following the solid principles in coding, highlighting the five key principles: single responsibility, open-close, liskov substitution, interface segregation, and dependency inversion, stressing the importance of clean and concise code structure and the minimal use of comments.', 'duration': 134.89, 'highlights': ['The SOLID principles, including single responsibility, open-close, Liskov substitution, interface segregation, and dependency inversion, are essential for maintaining clean and concise code structure.', 'Emphasizing the minimal use of comments by naming variables and functions descriptively to eliminate the need for redundant comments.', 'The chapter stresses the importance of code quality and structure, promoting the use of unit tests as a form of documentation to explain application evolution.', 'The speaker highlights the redundancy and crutch-like nature of comments in bad code, emphasizing the aim to improve code quality to eliminate the need for excessive comments.', 'The transcript introduces the history of the SOLID principles and their origin from Robert C., providing context for their significance in coding practices.']}, {'end': 4580.232, 'start': 4181.149, 'title': 'Understanding solid principles', 'summary': 'Introduces uncle bob, the author of clean code, the clean coder, and clean architecture, who introduced the solid principles in a paper in 2000, aiming to support certain development practices and agile methodologies, emphasizing the importance of solid principles in making code more understandable, maintainable, and flexible.', 'duration': 399.083, 'highlights': ['Uncle Bob introduced SOLID principles in a paper in 2000, aiming to support certain development practices and agile methodologies', 'SOLID principles help code to be more understandable, maintainable, and flexible', 'The single responsibility principle emphasizes good organization of code and understanding how good inheritance works', 'The open-close principle aims to extend class behavior without modifying it, promoting proper inheritance and easy swapping of different versions of services']}, {'end': 4951.854, 'start': 4582.779, 'title': 'Understanding solid principles', 'summary': 'Discusses the liskov substitution principle, interface segregation principle, and dependency inversion principle, emphasizing the importance of substitutability, decoupling, and abstraction in software design.', 'duration': 369.075, 'highlights': ['The Liskov Substitution Principle emphasizes that derived classes must be substitutable for their base class, illustrated through the example of a square extending from a rectangle.', 'The Interface Segregation Principle focuses on decoupling code by not forcing clients to depend on methods they do not use, enabling easy code overwrite and testing through interfaces.', 'The Dependency Inversion Principle advocates for high-level and low-level modules to depend on abstractions rather than each other, promoting flexibility in testing and mocking.', 'The Single Responsibility Principle emphasizes that every software module should have one reason to change, leading to smaller, more cohesive classes and reduced impact of change.']}], 'duration': 905.595, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4046259.jpg', 'highlights': ['The SOLID principles, including single responsibility, open-close, Liskov substitution, interface segregation, and dependency inversion, are essential for maintaining clean and concise code structure.', 'Uncle Bob introduced SOLID principles in a paper in 2000, aiming to support certain development practices and agile methodologies', 'Emphasizing the minimal use of comments by naming variables and functions descriptively to eliminate the need for redundant comments.', 'The chapter stresses the importance of code quality and structure, promoting the use of unit tests as a form of documentation to explain application evolution.', 'SOLID principles help code to be more understandable, maintainable, and flexible', 'The Single Responsibility Principle emphasizes that every software module should have one reason to change, leading to smaller, more cohesive classes and reduced impact of change.', 'The open-close principle aims to extend class behavior without modifying it, promoting proper inheritance and easy swapping of different versions of services', 'The Liskov Substitution Principle emphasizes that derived classes must be substitutable for their base class, illustrated through the example of a square extending from a rectangle.', 'The Interface Segregation Principle focuses on decoupling code by not forcing clients to depend on methods they do not use, enabling easy code overwrite and testing through interfaces.', 'The Dependency Inversion Principle advocates for high-level and low-level modules to depend on abstractions rather than each other, promoting flexibility in testing and mocking.']}, {'end': 5548.714, 'segs': [{'end': 4995.678, 'src': 'embed', 'start': 4951.854, 'weight': 1, 'content': [{'end': 4954.956, 'text': 'but i wanted to bring that up because that is an issue in itself.', 'start': 4951.854, 'duration': 3.102}, {'end': 4959.359, 'text': "so let's go ahead, and i want to share this link, actually real quick, before we jump into the code.", 'start': 4954.956, 'duration': 4.403}, {'end': 4960.42, 'text': 'but this is a um.', 'start': 4959.359, 'duration': 1.061}, {'end': 4970.444, 'text': "This is a link to uncle Bob's blog where you can read more about the single responsibility Principle here, and I think it's really helpful.", 'start': 4961.14, 'duration': 9.304}, {'end': 4971.544, 'text': 'so go ahead and check that out.', 'start': 4970.444, 'duration': 1.1}, {'end': 4974.285, 'text': "I'll put it in the description below as well.", 'start': 4971.544, 'duration': 2.741}, {'end': 4981.308, 'text': "But let's go ahead and see an implementation example of how we might use the single responsibility principle.", 'start': 4974.285, 'duration': 7.023}, {'end': 4992.355, 'text': "alright, so let's take a very simple example here of how we are not using the single responsibility principle and how we can go ahead and use it to make it better.", 'start': 4981.308, 'duration': 11.047}, {'end': 4995.678, 'text': "So, I'm doing this in TypeScript.", 'start': 4992.875, 'duration': 2.803}], 'summary': 'Discussion on implementing single responsibility principle in typescript', 'duration': 43.824, 'max_score': 4951.854, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4951854.jpg'}, {'end': 5359.278, 'src': 'embed', 'start': 5305.321, 'weight': 0, 'content': [{'end': 5316.286, 'text': "Well, now that we have this email class, If anything in our email class changes, then it'll auto update in our cache register or anywhere else.", 'start': 5305.321, 'duration': 10.965}, {'end': 5319.468, 'text': "we're using that class because it has a single purpose now.", 'start': 5316.286, 'duration': 3.182}, {'end': 5325.912, 'text': "And so that's really what the single responsibility principle is trying to instill.", 'start': 5319.988, 'duration': 5.924}, {'end': 5333.577, 'text': "A good rule of thumb when you're trying to decide what's what is.", 'start': 5326.372, 'duration': 7.205}, {'end': 5341.197, 'text': 'if you find yourself having to put and or or into your variable names and function names,', 'start': 5333.577, 'duration': 7.62}, {'end': 5346.139, 'text': "you oftentimes will see that you probably don't have things broken down enough.", 'start': 5341.197, 'duration': 4.942}, {'end': 5352.097, 'text': "And because of that, you're probably breaking the single responsibility principle.", 'start': 5346.879, 'duration': 5.218}, {'end': 5359.278, 'text': 'A good way to also help, and sometimes developers will find themselves in this.', 'start': 5353.057, 'duration': 6.221}], 'summary': 'Using a dedicated email class to adhere to the single responsibility principle and avoid overcomplicating variable and function names.', 'duration': 53.957, 'max_score': 5305.321, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE5305321.jpg'}, {'end': 5411.968, 'src': 'embed', 'start': 5385.948, 'weight': 3, 'content': [{'end': 5391.933, 'text': "That's another sort of gotcha to watch out for when using the single responsibility principle.", 'start': 5385.948, 'duration': 5.985}, {'end': 5394.896, 'text': "We're now on the open close principle.", 'start': 5392.053, 'duration': 2.843}, {'end': 5397.363, 'text': "Let's go ahead and jump right in.", 'start': 5396.223, 'duration': 1.14}, {'end': 5403.005, 'text': 'So what is the general idea for the open-close principle??', 'start': 5398.224, 'duration': 4.781}, {'end': 5407.787, 'text': "Well, you've probably heard this, if you've ever heard of the open-close principle many, many times.", 'start': 5403.045, 'duration': 4.742}, {'end': 5411.968, 'text': 'but software should be open for extension but closed for modification.', 'start': 5407.787, 'duration': 4.181}], 'summary': 'Open-close principle states software should be open for extension but closed for modification.', 'duration': 26.02, 'max_score': 5385.948, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE5385948.jpg'}], 'start': 4951.854, 'title': 'Javascript and typescript principles', 'summary': 'Covers the implementation and importance of single responsibility principle in typescript, and illustrates the need for separate classes in javascript for better code organization and maintainability. it also explains the open-close principle and its impact on code extension and updates.', 'chapters': [{'end': 4995.678, 'start': 4951.854, 'title': 'Understanding single responsibility principle', 'summary': 'Discusses the implementation of the single responsibility principle in typescript, emphasizing the importance of adhering to this principle for better code organization and maintainability.', 'duration': 43.824, 'highlights': ['The chapter emphasizes the importance of adhering to the Single Responsibility Principle for better code organization and maintainability.', "The speaker provides a link to Uncle Bob's blog for further reading on the Single Responsibility Principle.", 'The speaker demonstrates an implementation example of how the Single Responsibility Principle can be used to improve code organization.']}, {'end': 5548.714, 'start': 4995.718, 'title': 'Javascript single responsibility and open-close principles', 'summary': 'Discusses the single responsibility principle by illustrating the need for a separate email class for sending receipts, reducing code modification points, and then explains the open-close principle emphasizing the use of inheritance for code extension and minimizing code updates.', 'duration': 552.996, 'highlights': ['The chapter discusses the Single Responsibility Principle by illustrating the need for a separate email class for sending receipts, reducing code modification points.', 'Explains the Open-Close Principle emphasizing the use of inheritance for code extension and minimizing code updates.']}], 'duration': 596.86, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE4951854.jpg', 'highlights': ['The chapter emphasizes the importance of adhering to the Single Responsibility Principle for better code organization and maintainability.', 'The speaker demonstrates an implementation example of how the Single Responsibility Principle can be used to improve code organization.', 'The chapter discusses the Single Responsibility Principle by illustrating the need for a separate email class for sending receipts, reducing code modification points.', 'Explains the Open-Close Principle emphasizing the use of inheritance for code extension and minimizing code updates.', "The speaker provides a link to Uncle Bob's blog for further reading on the Single Responsibility Principle."]}, {'end': 6691.193, 'segs': [{'end': 5802.806, 'src': 'embed', 'start': 5749.391, 'weight': 4, 'content': [{'end': 5754.497, 'text': 'we will, we can have access to that, we can reference them here and not have any issues,', 'start': 5749.391, 'duration': 5.106}, {'end': 5763.885, 'text': "and We've successfully been able to extend the cash register class without actually modifying it.", 'start': 5754.497, 'duration': 9.388}, {'end': 5767.226, 'text': 'so open for extension, close for modification.', 'start': 5763.885, 'duration': 3.341}, {'end': 5770.367, 'text': 'now this is just one example, and a very simple one at that,', 'start': 5767.226, 'duration': 3.141}, {'end': 5777.83, 'text': "but these are the sort of things that you need to think about as you're developing code right.", 'start': 5770.367, 'duration': 7.463}, {'end': 5786.134, 'text': 'what separates a junior developer from a senior developer is the ability to not only make the code run, but both of you will have your code running,', 'start': 5777.83, 'duration': 8.304}, {'end': 5800.184, 'text': 'But having something that is going to last the tests of time to the best of our ability be easy and maintainable and testable to and allows change in a much more simplistic fashion.', 'start': 5786.454, 'duration': 13.73}, {'end': 5802.806, 'text': "So that's the open close principle.", 'start': 5800.684, 'duration': 2.122}], 'summary': 'Successful application of open close principle in code development.', 'duration': 53.415, 'max_score': 5749.391, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE5749391.jpg'}, {'end': 5852.575, 'src': 'embed', 'start': 5822.253, 'weight': 0, 'content': [{'end': 5831.259, 'text': "And if you've ever gone and pursued a bachelor's in computer science or really looked into the fundamentals of it,", 'start': 5822.253, 'duration': 9.006}, {'end': 5836.162, 'text': 'this wording will seem very similar, because a lot of these principles are worded in such a way.', 'start': 5831.259, 'duration': 4.903}, {'end': 5844.473, 'text': 'The idea from that stance is If S is a subtype of T,', 'start': 5838.123, 'duration': 6.35}, {'end': 5852.575, 'text': 'then objects of T may be replaced with objects of S without altering any of the desirable properties of the program.', 'start': 5844.473, 'duration': 8.102}], 'summary': "Bachelor's in computer science principles: s is a subtype of t, allowing replacement without altering program properties.", 'duration': 30.322, 'max_score': 5822.253, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE5822253.jpg'}, {'end': 6002.493, 'src': 'embed', 'start': 5951.568, 'weight': 7, 'content': [{'end': 5960.635, 'text': 'then that means that you broke something that that class is inheriting, because all your child class is doing is should be extending the behavior.', 'start': 5951.568, 'duration': 9.067}, {'end': 5971.188, 'text': "it should not be altering the behavior of a parent class right, and so, With that being said, let's go ahead and jump into an implementation of this,", 'start': 5960.635, 'duration': 10.553}, {'end': 5976.274, 'text': "because it's a little computer science heavy, but we'll give a good example.", 'start': 5971.188, 'duration': 5.086}, {'end': 5985.263, 'text': 'As with all things software, Stack Overflow had an excellent example, I think, that really hammers the Liskov substitution principle down.', 'start': 5976.894, 'duration': 8.369}, {'end': 5987.465, 'text': "So let's take a look at the code here.", 'start': 5985.844, 'duration': 1.621}, {'end': 5990.267, 'text': 'We have a rectangle class.', 'start': 5988.166, 'duration': 2.101}, {'end': 5992.688, 'text': 'A rectangle has a height and a width.', 'start': 5990.307, 'duration': 2.381}, {'end': 5995.59, 'text': 'They are independent of one another.', 'start': 5993.248, 'duration': 2.342}, {'end': 5998.731, 'text': 'The height can be any value and the width can be any value.', 'start': 5995.81, 'duration': 2.921}, {'end': 6002.493, 'text': 'Any positive value, I should say.', 'start': 5999.772, 'duration': 2.721}], 'summary': 'Understanding liskov substitution principle in software development.', 'duration': 50.925, 'max_score': 5951.568, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE5951568.jpg'}, {'end': 6231.731, 'src': 'embed', 'start': 6191.65, 'weight': 2, 'content': [{'end': 6194.272, 'text': 'And in here this will also be a number.', 'start': 6191.65, 'duration': 2.622}, {'end': 6201.939, 'text': "And from this, we'll have rectangle.", 'start': 6198.155, 'duration': 3.784}, {'end': 6203.7, 'text': 'We got that out.', 'start': 6202.959, 'duration': 0.741}, {'end': 6206.803, 'text': 'That extends shape.', 'start': 6204.08, 'duration': 2.723}, {'end': 6219.193, 'text': 'And we will have square that extends shape.', 'start': 6213.008, 'duration': 6.185}, {'end': 6226.127, 'text': "And now we have a class that if we were to swap it in and out, it'd be fine.", 'start': 6221.403, 'duration': 4.724}, {'end': 6231.731, 'text': "Now, granted, it's a very basic class and we don't even need type in this current iteration.", 'start': 6226.547, 'duration': 5.184}], 'summary': 'Basic class with rectangle and square, no need for type in current iteration.', 'duration': 40.081, 'max_score': 6191.65, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6191650.jpg'}, {'end': 6326.937, 'src': 'heatmap', 'start': 6240.198, 'weight': 1, 'content': [{'end': 6241.659, 'text': 'height and width are still gonna be numbers.', 'start': 6240.198, 'duration': 1.461}, {'end': 6243.68, 'text': 'Take out the type.', 'start': 6243.06, 'duration': 0.62}, {'end': 6247.143, 'text': "And that's all we're really checking for here.", 'start': 6244.901, 'duration': 2.242}, {'end': 6248.885, 'text': "There aren't gonna be any side effects.", 'start': 6247.163, 'duration': 1.722}, {'end': 6255.931, 'text': "but in our previous example we would have just fine by extending upon a rectangle, because we can't substitute for them.", 'start': 6249.565, 'duration': 6.366}, {'end': 6257.673, 'text': 'hence the substitution principle.', 'start': 6255.931, 'duration': 1.742}, {'end': 6265.921, 'text': 'The Liskov substitution principle is one of the harder ones, in my opinion, because you You almost have to be.', 'start': 6258.754, 'duration': 7.167}, {'end': 6270.642, 'text': 'you have to have very real world working examples before you sort of run into this issue.', 'start': 6265.921, 'duration': 4.721}, {'end': 6278.585, 'text': "We're going to be talking about the interface segregation principle in this episode of Code Like a Pro, the fourth principle of the solid principles.", 'start': 6271.103, 'duration': 7.482}, {'end': 6285.857, 'text': 'What is the idea? The idea is to not force the client.', 'start': 6281.016, 'duration': 4.841}, {'end': 6295.759, 'text': 'The client could be people consuming your class or your object or other developers.', 'start': 6285.877, 'duration': 9.882}, {'end': 6297.239, 'text': 'That could be third party in-house.', 'start': 6295.799, 'duration': 1.44}, {'end': 6302.7, 'text': 'Make it so that they are not forced to depend on methods they do not use.', 'start': 6298.4, 'duration': 4.3}, {'end': 6304.161, 'text': "That's the idea.", 'start': 6303.281, 'duration': 0.88}, {'end': 6313.566, 'text': "What does that actually mean? Well, it supports what we've sort of been talking about, which is smaller classes or interfaces.", 'start': 6305.901, 'duration': 7.665}, {'end': 6325.015, 'text': 'This idea of role interfaces, which is essentially breaking out into the smaller classes, classes and interfaces that should be defined,', 'start': 6314.446, 'duration': 10.569}, {'end': 6326.937, 'text': "and we'll give an example of that.", 'start': 6325.015, 'duration': 1.922}], 'summary': 'Discussing liskov substitution principle and interface segregation principle in solid principles.', 'duration': 55.834, 'max_score': 6240.198, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6240198.jpg'}], 'start': 5548.794, 'title': 'Solid principles in typescript', 'summary': 'Covers open close principle in typescript, emphasizing code flexibility and maintainability. it explains liskov substitution principle and provides an example of inheritance and subtype behavior. additionally, it discusses interface segregation principle, highlighting the importance of breaking down large interfaces for easier maintenance.', 'chapters': [{'end': 5802.806, 'start': 5548.794, 'title': 'Open close principle in typescript', 'summary': 'Discusses the open close principle using typescript, demonstrating the concept of extending a class without modifying it, to maintain code flexibility and ease of future modifications, emphasizing the importance of code maintainability and testability.', 'duration': 254.012, 'highlights': ['Demonstrating the concept of extending a class without modifying it', 'Emphasizing the importance of code maintainability and testability', 'Discussing the difference between junior and senior developers']}, {'end': 6248.885, 'start': 5803.186, 'title': 'Understanding liskov substitution principle', 'summary': 'Explains the liskov substitution principle, stating that if s is a subtype of t, then objects of t may be replaced with objects of s without altering any desirable properties of the program, and provides an example demonstrating how inheritance and subtype behavior should be maintained, with a focus on the potential issues with the square class extending the rectangle class.', 'duration': 445.699, 'highlights': ['The Liskov substitution principle states that if S is a subtype of T, then objects of T may be replaced with objects of S without altering any desirable properties of the program, emphasizing the importance of maintaining subtype behavior during inheritance.', "The example of a Square class extending the Rectangle class demonstrates how violating the Liskov substitution principle can lead to issues, as a perfect square's behavior contradicts that of a regular rectangle, highlighting the need to rethink code abstraction and inheritance structure.", 'The chapter emphasizes the importance of not altering the behavior of the parent class when extending a child class, stressing that the child class should only extend the behavior of the parent class without causing any additional setbacks or side effects.', 'A suggested solution to the issue of the Square class extending the Rectangle class is to potentially reorganize the code by creating a Shape class and having the Rectangle and Square classes extend the Shape class, ensuring that swapping in and out of the classes would not cause any issues.']}, {'end': 6691.193, 'start': 6249.565, 'title': 'Solid principles: interface segregation', 'summary': 'Discusses the interface segregation principle, emphasizing the importance of not forcing the client to depend on unused methods and the benefits of breaking down large interfaces into smaller role interfaces to support abstraction and easier maintenance.', 'duration': 441.628, 'highlights': ['The chapter discusses the Interface Segregation Principle, emphasizing the importance of not forcing the client to depend on unused methods.', 'The benefits of breaking down large interfaces into smaller role interfaces to support abstraction and easier maintenance.', 'The chapter also provides an example of refactoring a large interface into smaller interfaces such as iLights, iRadio, and iEngine to enable reusability.']}], 'duration': 1142.399, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE5548794.jpg', 'highlights': ['The Liskov substitution principle states that if S is a subtype of T, then objects of T may be replaced with objects of S without altering any desirable properties of the program, emphasizing the importance of maintaining subtype behavior during inheritance.', 'The chapter discusses the Interface Segregation Principle, emphasizing the importance of not forcing the client to depend on unused methods.', 'A suggested solution to the issue of the Square class extending the Rectangle class is to potentially reorganize the code by creating a Shape class and having the Rectangle and Square classes extend the Shape class, ensuring that swapping in and out of the classes would not cause any issues.', 'The benefits of breaking down large interfaces into smaller role interfaces to support abstraction and easier maintenance.', 'Emphasizing the importance of code maintainability and testability', 'Demonstrating the concept of extending a class without modifying it', 'Discussing the difference between junior and senior developers', 'The chapter emphasizes the importance of not altering the behavior of the parent class when extending a child class, stressing that the child class should only extend the behavior of the parent class without causing any additional setbacks or side effects.', "The example of a Square class extending the Rectangle class demonstrates how violating the Liskov substitution principle can lead to issues, as a perfect square's behavior contradicts that of a regular rectangle, highlighting the need to rethink code abstraction and inheritance structure."]}, {'end': 7255.884, 'segs': [{'end': 6782.849, 'src': 'embed', 'start': 6732.45, 'weight': 3, 'content': [{'end': 6741.617, 'text': "And we've now separated out piece by piece, so we don't have to and abstracted it, so that we don't have to rely on this massive vehicle interface,", 'start': 6732.45, 'duration': 9.167}, {'end': 6742.658, 'text': 'or class for that matter.', 'start': 6741.617, 'duration': 1.041}, {'end': 6751.866, 'text': "So, you know, it's a lot of these principles will sort of fall into that whole, they each sort of touch each other.", 'start': 6743.198, 'duration': 8.668}, {'end': 6755.649, 'text': 'Like some of this may feel very similar, single responsibility principle.', 'start': 6751.926, 'duration': 3.723}, {'end': 6758.952, 'text': 'And some of you may be saying like well, why am I importing??', 'start': 6756.19, 'duration': 2.762}, {'end': 6762.987, 'text': 'Why am I importing radio into the vehicle class?', 'start': 6760.303, 'duration': 2.684}, {'end': 6764.909, 'text': 'Well, you have to understand.', 'start': 6763.007, 'duration': 1.902}, {'end': 6769.535, 'text': "let's say, one of our developers wanted to use just a radio right?", 'start': 6764.909, 'duration': 4.626}, {'end': 6773.841, 'text': 'They had a need for a radio class and we wanted to follow that.', 'start': 6769.575, 'duration': 4.266}, {'end': 6782.849, 'text': "If it wasn't broken out like this, they would then be forced to install the vehicle class just to use the radio.", 'start': 6774.381, 'duration': 8.468}], 'summary': 'Transcript discusses principle of separating code for flexibility and avoiding unnecessary dependencies.', 'duration': 50.399, 'max_score': 6732.45, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6732450.jpg'}, {'end': 6831.803, 'src': 'embed', 'start': 6801.762, 'weight': 2, 'content': [{'end': 6810.748, 'text': "the dependency inversion principle, which is by far one thing that I would say I found I didn't fully understand,", 'start': 6801.762, 'duration': 8.986}, {'end': 6814.45, 'text': 'but is by far my favorite solid principle.', 'start': 6810.748, 'duration': 3.702}, {'end': 6823.797, 'text': 'And I think has made my software, my code writing taken to the next level.', 'start': 6814.851, 'duration': 8.946}, {'end': 6828.6, 'text': 'So I really hope you take particular interest in the dependency inversion principle.', 'start': 6823.857, 'duration': 4.743}, {'end': 6831.803, 'text': 'We are finishing up our section on the solid principles.', 'start': 6828.82, 'duration': 2.983}], 'summary': 'Dependency inversion principle has elevated code writing to the next level.', 'duration': 30.041, 'max_score': 6801.762, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6801762.jpg'}, {'end': 6926.379, 'src': 'embed', 'start': 6893.334, 'weight': 1, 'content': [{'end': 6896.537, 'text': 'And abstractions should not depend on low-level details.', 'start': 6893.334, 'duration': 3.203}, {'end': 6900.321, 'text': 'And we just want to generally support abstracting our code.', 'start': 6897.218, 'duration': 3.103}, {'end': 6910.684, 'text': 'Now the dependency inversion principle is quite unique in the fact that there are several great ways that you can use this.', 'start': 6901.334, 'duration': 9.35}, {'end': 6916.029, 'text': 'And remember, it relates to object-oriented programming, the solid principles.', 'start': 6911.084, 'duration': 4.945}, {'end': 6917.651, 'text': 'And in our code.', 'start': 6916.189, 'duration': 1.462}, {'end': 6926.379, 'text': "I'm going to give you an example of how I use it almost every day by creating mocks for testing and making sure that It is the test.", 'start': 6917.651, 'duration': 8.728}], 'summary': 'Dependency inversion principle supports abstracting code for object-oriented programming.', 'duration': 33.045, 'max_score': 6893.334, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6893334.jpg'}, {'end': 7049.584, 'src': 'heatmap', 'start': 6893.334, 'weight': 0.831, 'content': [{'end': 6896.537, 'text': 'And abstractions should not depend on low-level details.', 'start': 6893.334, 'duration': 3.203}, {'end': 6900.321, 'text': 'And we just want to generally support abstracting our code.', 'start': 6897.218, 'duration': 3.103}, {'end': 6910.684, 'text': 'Now the dependency inversion principle is quite unique in the fact that there are several great ways that you can use this.', 'start': 6901.334, 'duration': 9.35}, {'end': 6916.029, 'text': 'And remember, it relates to object-oriented programming, the solid principles.', 'start': 6911.084, 'duration': 4.945}, {'end': 6917.651, 'text': 'And in our code.', 'start': 6916.189, 'duration': 1.462}, {'end': 6926.379, 'text': "I'm going to give you an example of how I use it almost every day by creating mocks for testing and making sure that It is the test.", 'start': 6917.651, 'duration': 8.728}, {'end': 6935.265, 'text': 'mocks match our actual Implementation that matches our actual abstraction class, so that everything is synced up and working well together.', 'start': 6926.379, 'duration': 8.886}, {'end': 6936.666, 'text': "So let's go ahead and dive into it.", 'start': 6935.265, 'duration': 1.401}, {'end': 6940.708, 'text': "So let's take a little bit of some angular code.", 'start': 6937.286, 'duration': 3.422}, {'end': 6946.292, 'text': "This is going to be a mixture of typescript and angular, and what we're looking at is a service here.", 'start': 6940.708, 'duration': 5.584}, {'end': 6950.895, 'text': 'So this service is going to go and do some API call.', 'start': 6946.292, 'duration': 4.603}, {'end': 6958.06, 'text': "our service is called hacker news service and And it's pretty normal it's nothing out of the ordinary,", 'start': 6950.895, 'duration': 7.165}, {'end': 6962.404, 'text': "but it's not utilizing the dependency inversion principle,", 'start': 6958.06, 'duration': 4.344}, {'end': 6977.742, 'text': 'which would have us abstract a interface to allow us to not only extend this but make it so that other dependencies that are dependent upon this class are.', 'start': 6962.404, 'duration': 15.338}, {'end': 6985.023, 'text': "And so let's say we wanted to mock this file out for testing purposes because we already have our test.", 'start': 6978.082, 'duration': 6.941}, {'end': 6987.904, 'text': 'make sure Hacker News Service is doing what it needs to do,', 'start': 6985.023, 'duration': 2.881}, {'end': 6993.585, 'text': "but we don't necessarily want to actually use the actual implementation to make those API calls.", 'start': 6987.904, 'duration': 5.681}, {'end': 6995.886, 'text': "obviously so we're gonna have a mock class.", 'start': 6993.585, 'duration': 2.301}, {'end': 6999.786, 'text': "There's nothing tying these two together.", 'start': 6997.864, 'duration': 1.922}, {'end': 7009.474, 'text': "At the very least, we can tie them together and make sure that we don't have an issue with our mock not matching what it's supposed to be.", 'start': 7000.386, 'duration': 9.088}, {'end': 7018.086, 'text': "So how might we solve it? Well, if you had a interface In this case, we're using an abstract class, but it's the same idea.", 'start': 7009.534, 'duration': 8.552}, {'end': 7026.093, 'text': "But if we had a interface to invert the dependencies so that we don't really care about the low-level dependencies.", 'start': 7018.346, 'duration': 7.747}, {'end': 7033.96, 'text': 'and the low-level in this aspect is the actual implementation of the mock, the implementation of the actual service.', 'start': 7026.093, 'duration': 7.867}, {'end': 7037.424, 'text': "And instead, we're just going to define.", 'start': 7034.361, 'duration': 3.063}, {'end': 7049.584, 'text': "the actual class itself like so, what we're gonna do is we're going to take this and we're going to extend, the iHacker new service, which is fine.", 'start': 7038.601, 'duration': 10.983}], 'summary': 'Dependency inversion principle abstracts low-level details for better code testing and flexibility.', 'duration': 156.25, 'max_score': 6893.334, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6893334.jpg'}, {'end': 7123.703, 'src': 'embed', 'start': 7091.145, 'weight': 0, 'content': [{'end': 7095.967, 'text': 'it is extending the abstract class or the interface.', 'start': 7091.145, 'duration': 4.822}, {'end': 7103.169, 'text': 'now, in typescript, we have a way of injecting the interface and that would be how we would actually consume.', 'start': 7095.967, 'duration': 7.202}, {'end': 7106.751, 'text': 'this is, we would inject the interface into the class and then,', 'start': 7103.169, 'duration': 3.582}, {'end': 7114.259, 'text': 'depending upon our dependency injection method in angular you have modules that handle that.', 'start': 7106.751, 'duration': 7.508}, {'end': 7123.703, 'text': 'it would inject your actual surface itself, its service itself, while providing the the interface.', 'start': 7114.259, 'duration': 9.444}], 'summary': 'In typescript, interfaces can be injected into classes for consumption, particularly in angular for dependency injection.', 'duration': 32.558, 'max_score': 7091.145, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE7091145.jpg'}], 'start': 6692.802, 'title': 'Software design principles and dependency inversion principle', 'summary': 'Delves into software design principles including separation and abstraction of code, single responsibility principle, and dependency inversion principle, with detailed examples in typescript and angular, showcasing the benefits of flexible and quality code.', 'chapters': [{'end': 6782.849, 'start': 6692.802, 'title': 'Software design principles', 'summary': 'Discusses the separation and abstraction of code using interfaces and classes, exemplifying the single responsibility principle, to provide flexibility and avoid unnecessary dependencies, enabling developers to use specific classes without importing unnecessary ones.', 'duration': 90.047, 'highlights': ['The chapter emphasizes the separation and abstraction of code using interfaces and classes.', 'It exemplifies the single responsibility principle, promoting flexibility and reducing dependencies.', 'Developers can now use specific classes without importing unnecessary ones.', 'The radio logic has been separated into various interfaces, providing modular code structure.', 'This approach avoids the need to rely on a massive vehicle interface or class, promoting code modularity.']}, {'end': 7255.884, 'start': 6782.869, 'title': 'Dependency inversion principle', 'summary': 'Explores the dependency inversion principle, emphasizing its significance in enhancing code quality, and provides a detailed example of its application in typescript and angular, showcasing the benefits of abstracting code and utilizing interfaces for dependency injection.', 'duration': 473.015, 'highlights': ['The chapter explores the Dependency Inversion Principle and its significant impact on code quality, emphasizing its benefits in enhancing software development.', 'The chapter provides a detailed example of applying the Dependency Inversion Principle in TypeScript and Angular, showcasing the benefits of abstracting code and utilizing interfaces for dependency injection.', 'The speaker mentions utilizing the Dependency Inversion Principle almost daily, indicating its frequent practical application and impact on daily coding tasks.']}], 'duration': 563.082, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZihKWQXRBmE/pics/ZihKWQXRBmE6692802.jpg', 'highlights': ['The chapter provides a detailed example of applying the Dependency Inversion Principle in TypeScript and Angular, showcasing the benefits of abstracting code and utilizing interfaces for dependency injection.', 'The chapter emphasizes the separation and abstraction of code using interfaces and classes.', 'The chapter explores the Dependency Inversion Principle and its significant impact on code quality, emphasizing its benefits in enhancing software development.', 'It exemplifies the single responsibility principle, promoting flexibility and reducing dependencies.', 'Developers can now use specific classes without importing unnecessary ones.']}], 'highlights': ['The SOLID principles are essential for maintaining clean and concise code structure.', 'The series aims to teach professional coding and emphasizes the importance of writing maintainable and professional code.', 'The importance of clean and maintainable code for longevity and readability.', 'The importance of readable and maintainable code is emphasized, highlighting the need to avoid global variables, scope variables to limited scopes, use appropriate naming conventions for booleans and default parameters, and follow best practices for writing functions.', 'The importance of adhering to the Single Responsibility Principle for better code organization and maintainability.', 'The importance of using descriptive variable names and eliminating unnecessary variables for improved code readability and maintenance.', 'The chapter provides a detailed example of applying the Dependency Inversion Principle in TypeScript and Angular, showcasing the benefits of abstracting code and utilizing interfaces for dependency injection.', "The chapter discusses the benefits of using linters to enforce code standards, including replacing 'var' with 'let' or 'const', standardizing quotes, removing commented code, and choosing descriptive variable names.", 'The chapter emphasizes the importance of using descriptive variable names and nesting functions for clarity and context.', 'The chapter stresses the importance of code quality and structure, promoting the use of unit tests as a form of documentation to explain application evolution.']}