Slashdot Mirror


Has Flow-Based Programming's Time Arrived?

An anonymous reader writes "Flow-based programming keeps resurfacing lately. FBP claims to make it easier for non-programmers to build applications by stringing together transformations built by expert programmers. Many projects have already been using similar approaches for a long time, with less (or different?) hype. Is it time to take a closer look at flow-based programming? 'Clean functions – functions without side effects – are effectively pure transformations. Something comes in, something goes out, and the results should be predictable. Functions that create side effects or rely on additional inputs (say, from a database) are more complicated to model, but it’s easier to train programmers to notice that complexity when it’s considered unusual. The difficulty, of course, is that decomposing programs into genuinely independent components in a fine-grained way is difficult. Many programmers have to re-orient themselves from orthodox object-oriented development, and shift to a world in which data structures are transparent but the behavior – the transformation – is not.'"

14 of 268 comments (clear)

  1. Like libraries? by epyT-R · · Score: 3, Insightful

    old is new is old is new is old is...new?

    1. Re:Like libraries? by niftydude · · Score: 4, Insightful

      Actually, sounds more like LabView.

      Fishing through that programming environment's icon set for the correct function is very close to what I imagine hell must be like.

      --
      You can never know everything, and part of what you do know will always be wrong. Perhaps even the most important part.
    2. Re:Like libraries? by hobarrera · · Score: 4, Funny

      Old being the new new has already gotten old. Old is the new old, new is the new new.

    3. Re:Like libraries? by Joce640k · · Score: 3, Funny

      Actually, sounds more like LabView.

      Fishing through that programming environment's icon set for the correct function is very close to what I imagine hell must be like.

      They have an icon for every possible programming function?

      http://www.devtopics.com/wp-content/uploads/2009/04/image6.png

      --
      No sig today...
    4. Re:Like libraries? by fuzzyfuzzyfungus · · Score: 3, Insightful

      Actually, sounds more like LabView. Fishing through that programming environment's icon set for the correct function is very close to what I imagine hell must be like.

      I suspect that it's pretty strongly dependent on implementation, with two main drivers: On the one hand, you have the needs of essentially-not-programmers-at-all, who have some input that needs to travel through a series of tubes and get transmogrified. The results aren't going to be pretty; but it's a legitimate need. (there are also those who argue that it's a good pedagogical approach for young children, as in classic Klick 'n Play(published by Maxis in the US, international publishing and titles are strangely all over the map, or the more recent Scratch.

      On the other hand, "Flow-based programming" is essentially another flavor of Functional Programming, which seems likely to never truly die, no matter how obscure in real-world use, because of how central the concept of 'functions' in some reasonably generalized sense is to mathematics, ensuring a ready supply of people ready to charge into the breach and try to bring the elegance of pure mathematics to programming. Again.

  2. "easier for non-programmers to build applications" by Black+Parrot · · Score: 4, Insightful

    Gee, never heard that one before.
    What the people pushing these ideas don't seem to know is that it's not the tools, it's the way of thinking about a problem. I once worked at a place where we made a manager a tool that would let him create his own reports, and he immediately started adding up all flavors of apples and oranges (e.g., dollars of this and pounds of that). Then he wanted the small IT staff to help him make sense out of his reports.

    --
    Sheesh, evil *and* a jerk. -- Jade
  3. National Instruments LabView by KarlH420 · · Score: 4, Insightful

    NI LabView has had flow based visual programming for more than a decade. The nice thing is make parallel flows to your data, and it's multi-threaded.. It makes an easy way to visualize that something is run in parallel.

  4. The problem is the transformations don't exist by Todd+Knarr · · Score: 5, Insightful

    The basic problem is that, while it sounds great in theory, in practice the transformations you want don't exist. If they did, you'd have software doing the job already and you wouldn't need to create it. Your business isn't going to go very far just doing the same thing everybody else is doing, is it? You need to be doing something they aren't. Which means, in this context, you need transformations that don't already exist (either because they haven't been written yet (ideally) or because the people who wrote them are keeping them confidential to keep you from copying what their business is doing (less than ideal)). So on top of your FBP team stringing components together, you're still going to need that expensive conventional development team to write the components for the FBP team to string together. You haven't saved much, in fact it's probably costing you more than just having the conventional dev team.

    Plus, stringing components together isn't quite as simple as it sounds. Real-world systems usually depend on interaction and complex relationships between otherwise simple components. Keeping track of the synchronization between all those parts and keeping everything coordinated is usually the hard part. For instance, when creating an application to set up appointments the part where you take a set of existing appointment slots (some occupied, some free) and a set of one or more slots the customer would like ordered by preference and determine the best requested slot to put them in is easy. Picking up the current set of slots, putting them up on a Web page in a sensible way, letting the user select what ones work for them and set the order of preference, sending that information back to the server and, across this whole process, making sure that either nobody could alter the assigned appointments between the time you picked them up to display and the time the customer hit Submit and you started to sort out the assignment, that's nowhere near as simple. Doing this in a modern system with multiple servers where the submission may not go back to the server that handled the initial request, when you've got thousands of customers and hundreds of your users making, changing and cancelling appointments at the same time, ... can we say "highly non-trivial"? And it really doesn't fit the FBP model at all.

    Even where things fit the model, it's rarely as simple as "just string them together". I work with software that fits that model. Well, it did. Once. Long ago. And then the business people said "Oh, but customer A wants it do to some other thing if it's a transaction for them.". Followed by "Well, we want to do X, unless C applies in which case we want to do Y.". "Oh, unless M was specified for the account, in which case do X even when C applies except where X set V to 7 we need it set to 14.". Lather rinse repeat for 10 years and the quick one-line summary version ran to 5 pages single-spaced. Until that is we tried to print it out and found things were nested so deep some lines were starting past the right-hand edge of standard letter paper, so it's more like 10 pages, legal-sized, in landscape mode.

  5. Re:Isn't this just... programming? by phantomfive · · Score: 3, Interesting

    The two main problems of software engineering are getting data and control from where it is, to where it needs to be. Flow based programming focuses on those two aspects.

    When you look at a C or Java program, when you're looking through the source code, the main thing that is presented to your eyes is the actual algorithm, the code that is doing the work. Sometimes you have to do a lot of effort to even figure out where a program starts. A good class diagram can capture a lot of that, but usually there is still a lot missing in class diagrams. So you might say those languages are algorithm based or something.

    With flow based programming, when you look at a program, the first thing, and most obvious thing you see is the connections between modules; the way control and data are passed around the system is obvious. But you have to do extra work if you want to look inside the 'black box' modules that are actually doing the work.

    With apologies to Dijkstra, one might say that Flow Based programming is an exceptionally bad idea which could have only originated at IBM (in my mind the division of labor between those who are making the 'black boxes' and those who are connecting them together is extremely difficult to get right), but the idea of making the connections between modules more obvious is definitely a good one. I hate looking at new codebases sometimes for exactly the reason that it's hard to see how the modules are put together.

    --
    "First they came for the slanderers and i said nothing."
  6. A.k.a shell scripts by iamacat · · Score: 4, Interesting

    grep EVENT log*.txt | sort | uniq | awk '{print $2}' | ssh reportserver "gzip > results.txt.gz"

    Flow based, side effect free, distributed computing on one line. There is a reason shell scripts refuse to die in the face of python, perl or anything else.

  7. Re:Easier by AuMatar · · Score: 4, Insightful

    Welcome to the late 90s. Out here 15 years later, nobody uses UML. The idea of UML as code is completely dead, the corpse was staked, burned, and scattered to the four winds. It never worked. The only thing that's left of it is class diagrams, which people were doing 20 years before UML existed (if not longer).

    --
    I still have more fans than freaks. WTF is wrong with you people?
  8. Not this again! by beaverdownunder · · Score: 3, Informative

    This has been tried over, and over again many times over the last 30 years.

    It just plain-old doesn't work. You get inefficient, bloated code at the best of times, and 99% of the time you need some sort of custom function that still requires conventional software development.

    So, no, flow-based programming's time has _NOT_ arrived.

  9. Unix pipe by aralin · · Score: 3, Insightful

    So you mean like unix pipe. Where you have those wonderful transformations like sed, grep, cut, sort, etc ? Youngsters.

    --
    If programs would be read like poetry, most programmers would be Vogons.
  10. Re:No. by Rob+Riggs · · Score: 3, Informative

    I disagree. I have been playing around lately with GNU Radio Companion, designing SDR (software-defined radio) tools using a cheap DVB dongle. The transformations of the signal into a human-digestible format is made very easy. I am a software engineer -- I have written a lot of code. But there is a certain class of problems that lend itself to flow-based programming. GRC is one. And ETL tools are another. That is not to say that one does not, from time to time, have to write one's own code block. I have done that for GRC and for some ETL tools. But for 99% of what I have needed, a simple flow graph was all that was required.

    --
    the growth in cynicism and rebellion has not been without cause