3 ms·
On the other hand, recipes don't maintain global state, so they expose a functional interface (ingredients->result). A lemon meringue pie for lunch is assumed t
by reitzensteinm 13y ago
On the other hand, recipes don't maintain global state, so they expose a functional interface (ingredients->result). A lemon meringue pie for lunch is assumed to not influence the taste of roast pork for dinner.
Yes, functional programming is analogous to cleaning your kitchen. You heard it here first, folks.
- taeric 13y agoOnly in a sense of "non-shared" resources do not influence each other. Trying to clean your kitchen while cooking is not the easiest task to consider. Similarly, not realizing you lack the ingredients to make both breakfast and dinner due to few eggs indicates a shared state between them. More directly, if you do not clean your resources, eventually you will not be able to complete a task. Of course, I think this is the main appeal of functional in today's world. We have so much computing resources that it often does seem we have unlimited memory and such. Essentially we move from cooking area to cooking area such that someone can clean up after us, and we only carry with us the items we are interested in.
- eru 13y agoCooking uses linear typing, hence, you can only use your eggs once. Clean is a purely functional language with linear typing.
- taeric 13y agoI've never heard of that language. Amusingly, I had toyed in my head with the idea of modeling this language. Seems you pretty much have to have some notion of "dynamic" typing, since the type of a variable changes on calls to it. Thanks for the pointer, here is a link, for those that will also find this interesting. http://wiki.clean.cs.ru.nl/Clean http://wiki.clean.cs.ru.nl/Clean
- eru 13y agoIt's not really dynamic typing..