Events vs Commands: What's the difference?

Imagine you're playing with building blocks, that’s events and commands, all in one fun game!

Events: What Happens Around You

An event is like when something happens to you or around you. It's the news of what just happened.

For example, if your friend pushes a block off the tower, that’s an event! You didn’t do it, but you know about it.

Commands: What You Decide to Do

A command is like when you decide to do something. It's your choice or action in response to what happened.

If you see the block falling and say, “I will catch that block!”, that’s a command! You're taking control of the situation.

So, events are things that happen around you, and commands are your choices based on those events. They work together like a team, one tells what happened, the other decides what to do next! Imagine you're playing with building blocks, that’s events and commands, all in one fun game!

Take the quiz →

Examples

  1. A light turns on when you press a switch (this is a command), but if the light turns on automatically when someone enters a room (this is an event)
  2. You tell your friend to pass you the salt (a command), but your friend passes you the salt because they see you reaching for it (an event)
  3. A phone rings (an event), and you pick it up (a command)

Ask a question

See also

Discussion

Recent activity

Categories: Science · events· commands· technology