02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

OOP and DOM

Meet OOP

“OOP” means “Object Oriented Programming.” OOP is just a way to properly organize your code into logical components that are easier to program. Your code will be more organized, helping others to work as a team on your project: it will also reduce your code in size because OOP, through classes and objects, provides efficient ways of coding to achieve more by typing less. As you start coding and using objects, you will realize how much easier life is with OOP and you’ll wonder how you survived without it for so long!

Meet DOM

DOM stands for "Document Object Module": chances are you’ve heard this term before and even if you haven’t, don’t sweat it. DOM is a very basic (and legacy) way via which our JavaScript can interact with the HTML. Remember that JavaScript is placed in the HTML file so it can interact with the HTML objects. The DOM provides the interface/language that enables JavaScript to interact with the visual and textual elements of HTML

How can you learn in detail?

In today's world with modern 3rd party tools (such as jQuery) there are easier ways to interact with the DOM. The DOM is a bit cumbersome but if you want to learn how the environment works from scratch then we suggest you start with DOM: later on you can move to skills like Jquery. Using DOM will definitely help you to learn more and understand the structure of code in the HTML5 and JavaScript relationship.

If at any point you feel you're over your head or have forgotten more than you'd thought, simply visit the Developer Basics Section specially dedicated toward helping coders strengthen their coding basics by explaining and demonstrating the basic building blocks of any code.

It’s a bit early for us to get concerned about OOP and DOM; we will return to explore these topics in later videos. For now we just wanted you to have a casual introduction to these topics.

Video Transcript

00:00Now one thing I want to talk about before we dig deeper into this world of JavaScript
00:05is just I'm gonna throw a few terms that won't make a lot of sense, but
00:09It's something you need to be aware of and you'll be more and more aware of it
00:13The more you're working in JavaScript. There are two things one is JavaScript is an object-oriented programming language
00:18Which means basically that every single thing
00:22Relates to something that is that you could put it supposedly inside of an object
00:26So if we take it into the real world
00:28more or less is saying that everything you create belongs to something else if you see an eye that eye belongs to a person or
00:35Head and that head belongs to a person that person belongs to earth and earth belongs to the galaxies and so on and so forth
00:42Everything has some sort of relationship an object-oriented programming language
00:46That's basically its main definition where things could belong to other things well
00:51There were procedural languages that things were just floating you could create things
00:55You could have an eye, but then I doesn't belong to anything an object-oriented
00:59Object-oriented world things have belongings they have relationships
01:03And as you build and you start programming the more you are aware of this idea
01:08The easier it becomes to program because then you realize that you're interacting between different objects now if that sounded scary
01:15Don't worry about it too much because we're not gonna even think about that anymore for the next 20 30 minutes now
01:21Next thing I want you to be aware of is that I'm sure I'm not sure but you probably heard of this term before dumb
01:28Which is the document object model?
01:31Now the Dom is a really really important legacy
01:34Way of interacting between how we're gonna take our JavaScript and have it interact with our HTML which are again
01:40We're only gonna do that in 20 30 minutes after we get used to all these different language
01:45elements, so
01:47Basically what it means is it's a it's an interface
01:49It's a way for us to talk to different elements inside of our application
01:54That's really the definition of the Dom the Dom exists for in JavaScript
01:59Which basically exists in the the API of the browser to enable JavaScript the language to interact with the visual and
02:06Textual elements that are on the page
02:08That's true by the way also for XML now
02:11There's better ways of dealing with interacting with with the page than the Dom wave
02:16Which is a little bit hard and cumbersome
02:18But the good good news with that is there are a lot of third-party APIs which makes make life really really easy such as jQuery
02:25But before you really could start playing with them
02:27You really need to understand what the Dom is how it works
02:30Even if you're never gonna do it on your own anymore after that and you're always gonna use a tool to help you out
02:36It's important for you to understand the environment because if you understand the environment is gonna get easier and easier as you go by

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!