trexitycode / wirestate

MIT License
1 stars 0 forks source link

Discussion: should the final state character (!) be on each state? #2

Open matb33 opened 5 years ago

matb33 commented 5 years ago

Should we have it only on the actual final state node itself?

e.g.

Start
  done -> Done!
Done!

vs

Start
  done -> Done
Done!

@JulsRicketti brought it up, pointing out that for initial states (*), it's not necessary to repeat that one.

dschnare commented 5 years ago

I had followed the syntax rules from sketch systems. Basically, treated ! same weight as ? (i.e. as part of the state name), and figured you might want to be reminded that this state is final by seeing it in the state name everywhere it's referenced.

Does it add value having it as part of the state name? Or should we not make it part of the state name? What about ? character, should this not be included either and be treated like any other modifier?

dschnare commented 5 years ago

I think having a modifier repeated in the state name only really serves as a reminder of the intent of the state (i.e. is it final and/or interrogative). Maybe this is not necessary though, and modifiers are just modifiers.

matb33 commented 5 years ago

Personally, I don't think it's needed everywhere as a reminder. When you think about it, in regular xstate, it's not like you repeat type: 'final' everywhere... only on the actual final state

dschnare commented 5 years ago

@CMORPHY @ako977 @JulsRicketti what are you thoughts on this?

Personally, I don't think making ! not part of the state name (unlike the ? modifier) harms anything. I think @matb33 is right, it doesn't give much benefit with it part of the state name.

I'd still suggest we treat ? as part of the state name however.