hyperapp icon indicating copy to clipboard operation
hyperapp copied to clipboard

Rename model to state.

Open jorgebucaran opened this issue 9 years ago • 24 comments

Please šŸ‘ or šŸ‘Ž.

jorgebucaran avatar Mar 30 '17 11:03 jorgebucaran

Those terms make no difference to me, so no need to change it.

nichoth avatar Mar 30 '17 17:03 nichoth

Since we changed updates to actions, following the redux/Vuex semantics would be nice. Renaming to state makes sense šŸ‘

selfup avatar Mar 30 '17 17:03 selfup

Model is something from MVC frameworks to me, and I still get confused for a second when I stumble upon it in Hyperapp. Choo, Yo-yo, React/Preact all call it state, so I’m in favor of renaming for consistency.

arturi avatar Mar 30 '17 18:03 arturi

@jbucaran I'm in favor of state since a friend of mine was confused about the difference between model and state and this terminology is one of the things he considers confusing about hyperapp.

Of course that's anecdotal, but I don't care.

FlorianWendelborn avatar Mar 30 '17 20:03 FlorianWendelborn

I don't mind either, and the reason I chose model was TEA, but I also agree with some people finding model confusing since the most widespread term is state anyway.

jorgebucaran avatar Mar 30 '17 23:03 jorgebucaran

Hi @SkaterDad @nichoth @cdeutmeyer!

If you have a minute, can you explain why you dislike / disapprove this notion?

jorgebucaran avatar Mar 31 '17 17:03 jorgebucaran

i upvoted state, but if you intend to stay close to TEA, then it may be worth sticking to its terminology [1].

[1] https://guide.elm-lang.org/architecture/

leeoniya avatar Mar 31 '17 17:03 leeoniya

@leeoniya You're right, but TEA also has the word update which we don't use anymore.

@dodekeract Does your friend find hyperapp confusing just because of the world model? Seems an extreme position to take just because of a word. Just curious.

jorgebucaran avatar Mar 31 '17 18:03 jorgebucaran

@jbucaran No, mainly because of the differences to react/redux. He's currently trying to learn how to create SPAs and react/redux is the stuff he's currently attempting to learn.

FlorianWendelborn avatar Mar 31 '17 18:03 FlorianWendelborn

Gotcha. Good choice anyway. Reminds me of this.

jorgebucaran avatar Mar 31 '17 18:03 jorgebucaran

I'm really fine with it either way.. I just like sticking as close as possible to Elm terminology.

cdeutmeyer avatar Mar 31 '17 18:03 cdeutmeyer

In my mind "model" is more related to MVC and other OOP paradigms, and "state" is more connected to functional programming (where state management is made explicit instead of implicit). Mixed with the previous departure from the Elm architecture nomenclature, I'd go with "state".

danigb avatar Mar 31 '17 22:03 danigb

my reasoning was same as @danigb

leeoniya avatar Mar 31 '17 22:03 leeoniya

@jbucaran The community is mostly in favor of this change. Can we implement it?

Also something somewhat related: when we link to code pens we should make sure they don't use hyperapp@latest since hyperapp is currently not stable enough for that. We should always link to [email protected] or similar.

FlorianWendelborn avatar Apr 01 '17 16:04 FlorianWendelborn

@dodekeract You are right, but latest refers to the published npm version, which is working fine AFIK.

jorgebucaran avatar Apr 01 '17 16:04 jorgebucaran

Can we implement it?

Yes, let's do so after #172 is merged please.

jorgebucaran avatar Apr 01 '17 16:04 jorgebucaran

@jbucaran Yes, it's working fine. right now. This leads to all hyperapp codepens breaking as soon as we publish breaking changes. This is especially relevant for forked codepens that inherit from our examples.

FlorianWendelborn avatar Apr 01 '17 16:04 FlorianWendelborn

@dodekeract Fortunately CodePens URLs don't change, so I just need to update the code. JSFiddle URLs do change, so I'll have to rewire everything or ditching JSFiddle.

jorgebucaran avatar Apr 01 '17 16:04 jorgebucaran

@jbucaran You don't see the problem. People fork our examples. This means they inherit this time bomb that destroys their codepens as soon as we introduce another breaking change.

FlorianWendelborn avatar Apr 01 '17 16:04 FlorianWendelborn

@dodekeract Ah, you're right... 😄

jorgebucaran avatar Apr 01 '17 16:04 jorgebucaran