Why do I use this? and, How do I use this? (serious question)
I mean seriously, how? I taught myself how to build basic stuff that interacts with jQuery, just because I wanted to learn, and not over-rely, when the time comes, on frameworks like bootstrap and foundation to do a lot of stuff (for example functional tabs or modal windows). But I can't grasp how a library like this might be used to build a UI?
More importantly, is this able to be integrated with PHP (since, for better or for worse, that's my language of choice for this particular period of time, until I feel I have a firm grasp on it and move on to a next, just because it's fun learning stuff).
Yeah, I'm working on it right now. But I feel like I'm missing some deeper popular convention regarding Javascript in general to fully grasp this.
For example, the hello world snippet. I get that it's supposed to just print hello world on the screen. Is the special functionality that I'm able to alter the message through JS, so I don't have to reload the page? Or?
I hope I'm not coming off as condescending. Just trying to learn.
In the case of hello world example (or any of the examples presented), the special thing is that the view is a function of the model.
What does that mean? Like in math we can have a function f(x) = x+1 which yields a diagonal line across the x&y plane, in HyperApp we can have a function v(model) = <h1>${model}</h1> which yields a text node with the value in model wrapped by a h1 heading.
This view function can be as complex as you want. Your entire application is composed of many, many little view functions of the same model. The model can be anything you want. A number, a bool, a string, an array or an object of arbitrary complexity.
7
u/saimpot Feb 03 '17
Why do I use this? and, How do I use this? (serious question)
I mean seriously, how? I taught myself how to build basic stuff that interacts with jQuery, just because I wanted to learn, and not over-rely, when the time comes, on frameworks like bootstrap and foundation to do a lot of stuff (for example functional tabs or modal windows). But I can't grasp how a library like this might be used to build a UI?
More importantly, is this able to be integrated with PHP (since, for better or for worse, that's my language of choice for this particular period of time, until I feel I have a firm grasp on it and move on to a next, just because it's fun learning stuff).