Hacker News new | ask | show | jobs
by Digitalis33 2311 days ago
FIFY

Operations ^H^H^H Functions A common function for applications is logging a user in. It’s actually two sub-functions composed together: first get the email address and password from the user, second load the “user” model from the database and check whether the password matches.

Functions are the doers of the MFVE world. They are responsible for making changes to your models, for showing the right views at the right time, and for responding to events triggered by user interactions. In a well factored application, each sub-function can be run independently of its parent; which is why in the diagram events flow upwards, and changes are pushed downwards.

What’s exciting about using functions in this way is that your entire application can itself be treated as an function that starts when the program boots. It spawns as many sub-functions as it needs, where each concurrently existing sub-function is run in parallel, and exits the program when they are all complete.

1 comments

"What’s exciting about using functions in this way is that your entire application can itself be treated as an function that starts when the program boots."

HN, rediscovering main()