https://nextjs.org/learn/foundations/from-javascript-to-react/updating-ui-with-javascript
Imperative vs Declarative Programming
The code above is a good example of imperative programming. You’re writing the steps for how the user interface should be updated. But when it comes to building user interfaces, a declarative approach is often preferred because it can speed up the development process. Instead of having to write DOM methods, it would be helpful if developers were able to declare what they want to show (in this case, an h1 tag with some text).
In other words, imperative programming is like giving a chef step-by-step instructions on how to make a pizza. Declarative programming is like ordering a pizza without being concerned about the steps it takes to make the pizza. ?
imperative programming - 하드코딩 반대?! 느낌?, 원리를 이해한 코딩
declarative programming - 하드코딩?!, 바로 써버린 코딩