This tutorial will guide you through creating a basic ToDo app. The app will add tasks, mark them as done, and filter them by status. We will build it three times, using structured, functional, and object-oriented programming methods.
Structured programming uses loops and conditional statements to organize code. Procedural programming, an extension of structured programming, organizes code around functions. We’ll start with structured and procedural programming, focusing on writing clean code.
Next, we’ll use functional programming, which promotes a declarative style of coding and treats functions as first-class citizens. We’ll apply functional programming concepts like higher-order functions and closures to recreate the ToDo app. Although not necessary for this application, it illustrates functional programming in JavaScript.
Lastly, we’ll use object-oriented programming, which organizes code around objects that contain data and behavior. We’ll create classes and employ object-oriented programming concepts to rewrite the code. Like functional programming, it’s not required for the ToDo app, but it illustrates object-oriented programming in JavaScript.
By the end of this tutorial, you’ll understand these three programming methods and how to apply them in your code. You’ll also have a working ToDo app that displays the key concepts and techniques discussed.