Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace statement by expression #759

Closed
wants to merge 1 commit into from
Closed

Replace statement by expression #759

wants to merge 1 commit into from

Conversation

posva
Copy link
Member

@posva posva commented Feb 11, 2017

Closes #754

@chrisvfritz
Copy link
Contributor

Well, these are actually statements rather than expressions. An expression will always return a value, whereas a statement is just executed code which does not necessarily return anything. In this example for instance, the inline if statement does not return anything, but it still works within v-on.

For some other directives, like v-if, we do require an expression because we use the returned value to check for truthiness.

Does that make sense?

@posva
Copy link
Member Author

posva commented Feb 11, 2017

Oh, wow, didn't know that haha
Yes, makes sense!

@chrisvfritz
Copy link
Contributor

No worries! 🙂 There's so much jargon in computer science and the names are often very poor.

  • Declaration
  • Statement
  • Expression

The meaning of these words is almost identical in human languages, so they seem like very poor choices to describe different things when programming. "Statement" is so general as to be almost useless and "expression" doesn't at all describe what it is. 😂 It should be called a "returnable" or "value producer" or something.

As the songwriter / amateur philosopher Harry Chapin once said:

Sometimes words can serve me well. Sometimes words can go to hell.

😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants