Bemi Faison wrote: > Scott Sauyet wrote: > I've finally written a guide to using Flow. I've never written a walk- > through before, and would appreciate everyone's feedback! Check it out > at https://github.com/bemson/Flow/wiki/Using-Flow
This is reasonably well written. It's certainly easy to follow, and the example is clean. But to me it's missing something basic. Your guide still really only explains *how* to use Flow. Even after reading it and reading many of the examples on your site, I'm still not clear on *why* I'd want to use it. I feel I could code a modal login form with pass and fail handlers for the submit in no more code using straightforward composing of small functions. I'm just not sure yet what Flow has to offer me. Don't get me wrong. I'm intrigued; I want to know more and to see if it will help me with some of my more complex problems. But so far, what I've seen is simply a way to make some of the ordering of my steps more declarative. While that is itself worthwhile, I'm pretty sure you have quite a bit more in mind here. As to the details, I have two fairly minor quibbles and one more serious objection. The first is really trivial: what's with the underscores? You're defining the constructor, so why "_main" rather than "main"; it seems clunky. More importantly, though, I object to this: var page = new Flow({ _in: function () { [..something..].addEventListener('click', page.modal, false); // ... }, // ... }); That internal reference to the external `page` variable is scary. The object you create here can be aliased and replaced, and such a reference would then point elsewhere. Can you either use `this` or pass in a reference to the object? But my largest objection now is the same one that was brought up earlier in this thread. Using the order of the definitions to determine the order your functions run is a show-stopper for me. I just would not want to count on that for the functionality of my program. The minute a browser upgrade changed that, my program would abruptly fail. I might play with Flow to see where and how it might help me. But with that behavior, I would never deploy it to a site that actually needed to work. >> I don't understand what you mean by "you can't trust functions." I >> find it surprising because I for one try to use JS in a manner much >> more like I'd use a functional language than I would, say, an object- >> oriented one. Functions are to me the basic building blocks of the >> language. > > _Trusting_ functions does sound odd. I guess I've been bitten one too > many times from "bad" functions. > > Imperative languages have a knack for being dangerous, and JavaScript > is no different. By definition, a function is a black-box of > implementation. They run when they're called, asking and giving no > context for their execution. When something breaks, we waste hours > searching for the exact scenario we did *not* code for. (Only the > sharpest minds could track so much complexity.) I guess I simply have not had the issues you've had with functions. Every now and then some unexpected closure might still bite me, but I just don't have similar experiences. My functions tend to be called when expected with their expected context. > Yes, it's extreme, but I don't trust functions anymore. That's why I > created and use Flow. ;-) ... which is chiefly a way to order the execution of those untrustworthy devils?! :-) -- Scott -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com