Imperative Programming
noun
say it: “im-PAIR-uh-tiv PROH-gram-ing” /ɪmˈpɛrətɪv ˈproʊɡræmɪŋ/
Writing out each step the computer must take to get a result.
What is Imperative Programming?
Imperative Programming — Writing out each step the computer takes to get a result. Finding a button in code and calling addEventListener is imperative; an onclick attribute in the HTML is the declarative way to get the same result.
const button = document.getElementById("add");
button.addEventListener("click", () => addToCart(7));
In a sentence
- “Finding the button and calling addEventListener is imperative programming.”
Level: Journeyman · More Software Development terms at this level
Updated