From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Imperative versus declarative programming and web development

Imperative versus declarative programming and web development

With this code that we've written from the previous video, we're updating the DOM with plain JavaScript. We've got the plain JavaScript here in our HTML, and we've now seen that we're updating it with this is my web application, and we've proven it by looking in our actual elements and seeing how there's this h1 tag. We never wrote that, that's the update. That's the update. If I refresh, it comes back, it's updated so fast that we don't even notice it. So writing plain JavaScript to make web applications like this and updating the DOM directly, it's very powerful, but as the size of an app or a team grows, this can get more and more challenging and complicated to build and complicated for nothing. If you're going to use this approach, most of the time developers are going to spend a lot of time writing instructions to tell the computer how to how to do things step by step. Okay, so this is really the difference between imperative versus declarative, between imperative programming…

Contents