OOP with TypeScript: Good Practices


English (Auto-generated)

object oriented programming in typescript we just recovered the basics of how we can actually create an object and how we can utilize it. So there there are a few fun facts. I mean a few important things actually. So why why the the object oriented programming is important or necessary even though you can create a complete program. I mean without using the object oriented programming. But it is preferred because um there there is a factor you know, state and the view. So sometimes in your application in fact most of the times the beginners, what the beginners does they actually update the view of the application instead of updating the state of the application. For example, um The application, you know we want to show some results. For example if we want to show the 10, I mean the digital 10 somewhere. So what we do we actually update the view of the application. So yeah we can show that number 10 somewhere. But instead what if we update the state of the application and reflect the update to reflect the view? This is a very important practice. So we often doesn't understand and doesn't utilize this way. So the view should not be updated. But the the state state should be updated. For example You just don't create the variable whenever you want. So for example I'm creating a variable right now. The War one More one and I just put the value of anything. Instead it is preferred that I create an estate. Okay. For now we can consider like you know a simple object as an estate. So just consider this in the state. So this should be let. Okay, now for example, you wanted multiple multiple variables in your project. So instead uh multiple variables in the area multiple variables. So instead you just created one object, you BJ one and in this oh, BJ one, what do you do? War I equals to some value like, you know, value one. And then war too some more value value to. So these two can be different variables. Instead, we created in a state of the application. Now whenever we want to update anything in the uh in the application we will not be updating the view but we will be updating the state and we will simply reflecting the state. So this keeps the work collected and this makes the work unique and simplified. So this is a very simple practice and this is why the object oriented programming is important. One more thing that oh, I got some notification, which is really not necessary for us anyway, so this is an important practice. Uh and this is why we use the object oriented programming. One more thing I was discussing, I just forgot. Yeah, every framework utilizes the object oriented programming approach um like you know, the um they react the angular the view and the many of their frameworks the next the next. Okay, so all of them uses the the object oriented programming approach because the object oriented programming is great and the collected kind of collective thing. Object oriented programming is modular based and absolutely. You know, everything in object oriented programming is, uh, is combined together, but in pieces and we call them components. So each module can be called a component in the inner framework. And by using the object oriented programming. So after learning whatever we've learned, you are now capable to start angular or to start working on the react. Because now, you know, the basics of the object oriented programming in the next video. In the next series. Actually, we will be having some different videos and hoping we will be covering some more javascript or typescript topics until then stay tuned.
176 Views 0 Likes 0 Comments

Let's talk about what good practices are and some common good practices to use in TypeScript.

Leave a comment (supports markdown format)