Slashdot Mirror


How Reactive Programming Differs From Procedural Programming

Nerval's Lobster writes "A recent post on Reactive Programming triggered discussions about what is and isn't considered Reactive Logic. In fact, many have already discovered that Reactive Programming can help improve quality and transparency, reduce programming time and decrease maintenance. But for others, it raises questions like: How does Reactive differ from conventional event-oriented programming? Isn't Reactive just another form of triggers? What kind of an improvement in coding can you expect using Reactive and why? So to help clear things up, columnist and Espresso Logic CTO Val Huber offers a real-life example that he claims will show the power and long-term advantages Reactive offers. 'In this scenario, we'll compare what it takes to implement business logic using Reactive Programming versus two different conventional procedural Programming models: Java with Hibernate and MySQL triggers,' he writes. 'In conclusion, Reactive appears to be a very promising technology for reducing delivery times, while improving system quality. And no doubt this discussion may raise other questions on extensibility and performance for Reactive Programming.' Do you agree?"

186 comments

  1. I thought that we were supposed to be pro-active.. by PaulBu · · Score: 1

    not re-active! ;-)

    Paul B.

  2. Marketing 101 by s.petry · · Score: 4, Insightful

    There really is no such thing, they just made up the term for attention. What he is describing might be called "tools" programming, but it's not new or different. I have written "Tools" in various languages for over 20 years. If they think they are going to market a few bucks with a "re-branding" program good for them. It worked for "Cloud" and I knew better then too.

    --

    -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

    1. Re:Marketing 101 by Anonymous Coward · · Score: 5, Funny

      Here's a quote for your marketing:
      Q: How does reactive programming differ from procedural programming?
      A: People use procedural programming, they only talk about reactive programming.

    2. Re:Marketing 101 by danbuter · · Score: 1

      So, is this a new slant on Agile Programming?

    3. Re:Marketing 101 by sunderland56 · · Score: 4, Funny

      There really is no such thing,

      Of course there is - I've been reactive programming for years. My boss yells at me to do something, and I react.

    4. Re:Marketing 101 by s.petry · · Score: 3, Insightful

      I think it's supposed to be being touted as a special new language because we need "reactive" programming hence the name "Reactive". The language may be "new", but I doubt it. I have not looked honestly, I looked at the claim on why it's needed and call bullox. I have mountains of libraries I have written for various tools in C, Python, Perl, and various scripting languages (TCL/WISH/SH). Most of those use bits of the mountains of libraries developed for those languages.

      I'm getting cynical in my age I guess, but the majority of the claims people make are simply fluff to try and make a buck or name. Claiming that we need a new language for a special case is silly. Develop and release a library(or libraries) for your needs so that people can use it. Otherwise we end up with all these little tufts of crap that 3 people in the world use, and have to listen to them complain about why adoption is so low.

      --

      -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

    5. Re:Marketing 101 by jythie · · Score: 1

      It looks more like a domain specific language with a propriety tool/library of some type. Anything that can, as they claim, reduce 500 lines of code into 5 lines probably is not terribly general purpose. It looks like it is just a rebranding of event driven programming only done in their own tool rather then a standard language, probably doing a few things automagically and a whole bunch of stuff badly.

    6. Re:Marketing 101 by Bite+The+Pillow · · Score: 2

      You clearly don't understand.

      If you abstract the idea to a framework, and let the framework take care of the work, you have less programming to do.

      And if your framework is domain-specific enough that it can watch one column and update another with very simple rules, without injecting a custom validation layer, then you have it very easy.

      Your code base being 5 lines means that only 5 lines of code execute, and anything else that happens behind the scenes require no learning, support, fixing, bug reports, testing, or really any attention at all, because it works for your domain-specific problem.

      So, you have your "ordering" framework, one for "matching address rules to geographical locations" validation framework, your "content management system that uses plain text to deliver content" framework... oh, there is a framework for every need. That's how simple it is.

      And, NO ONE HAD TO WRITE THE FUCKING FRAMEWORK.

      That last part is the important one, it's how you achieve time to market and bug-free nature of the code. Just give up and believe.

    7. Re:Marketing 101 by Anonymous Coward · · Score: 0

      Most of these new flava-flav languages are usually interpreted, or at the very best, badly JITed. So the performance will be worse than your mountains of existing C libraries. Certain also, the esoterism these flava-flav folks will foist on you will place an enormous burden on you, reducing your productivity as much as it does reduce your program's performance.

      Anyone who doesn't know and understand that you can implement ANY programming paradigm in C without even trivial difficulty or obfuscation, shouldn't be programming in ANY language. Unfortunately this is 90% of working programmers today. And a single bad programmer creates much work for many good programmers. Oh god, what a sorry state the industry is in.

    8. Re:Marketing 101 by Anonymous Coward · · Score: 0

      And, NO ONE HAD TO WRITE THE FUCKING FRAMEWORK.

      That last part is the important one, it's how you achieve time to market and bug-free nature of the code. Just give up and believe.

      bug-free

      Yea, fucking, right.

      Using someone else's framework, I have to fix my bugs, and someone else's bugs too.

    9. Re:Marketing 101 by VortexCortex · · Score: 1

      I'm getting cynical in my age I guess, but the majority of the claims people make are simply fluff to try and make a buck or name. Claiming that we need a new language for a special case is silly. Develop and release a library(or libraries) for your needs so that people can use it. Otherwise we end up with all these little tufts of crap that 3 people in the world use, and have to listen to them complain about why adoption is so low.

      I can say this because your cynicism plays directly into my game. The new paradigm is Meta Programming. With my new Meta Programming tools I can write code in one single language and compile it into any other language that has an open source parser. My style guide language ensures the output code is consistent with whatever project I need produce code for. You are both the perfect candidate for, and also most likely not to learn such a language / platform.

      That is why the creation of new languages and paradigms are needed for optimal competition. You see, the more divided they are, the more easily I can conquer them with my one language to rule them all. Yes, the little used obscure or languages can be leveraged. I can add that specialization to my capability feature-set with ease. As my library of meta code has grown I can now tackle even very large projects with very few programmers on the job, deployment is a bigger concern than (re)programming now. I can undercut nearly any bid with a far higher quality of output than my competitors -- And do it again and again on virtually any platform.

      I once thought as you, and then I realized I could not stem the flood of wheel reinvention without reinventing the wheel myself. You wouldn't put a wagon wheel on a sports car... I sought to end this madness once and for all, but soon I would realize that I must not for fear of even greater madness. Humanity is not ready for this powerful technology. It will wait to be released until after I retire from the competitive market. You may think me greedy, but I am not. You just haven't seen the horror of a library including all manner of design patterns as utilized in Java or C/C++ compiled into SQL triggers with a single external main() function interfacing the DB query. I recoiled in horror at my first glimpse of at this Thing-that-Should-Not-Be, even as I allowed the birth of ever more monstrous abominations: An entire Trouble Ticket system running atop Apple Script. Excel spreadsheets hosting systems diagnostic tools. JavaScript crashing browsers running AI meant for Prolog.

      I sat in perverse fascination as Ruby on Rails destroyed an entire Intranet to produce a glacial slide show of spinning tetrahedron via distributed 3D software rasterizer. No! Cluster fscks of epic proportions flashed before my eyes, and it was soon clear that you do not have the technology to defend against such terrible beasts. I mused, "Well, surely none would do such things in real world applications", but I knew I was wrong before my search began. Do you understand the Danger that approaches?! Have you seen ASM.js?!

      With great power comes great responsibility. For once someone will decide that just because we can doesn't mean we should. If true Meta Programming is unleashed before the world is ready the blood won't be on my hands. For a queer little project an aged experienced dev can learn a new language or methodology in a matter of days, then it's only the API ref you'll require, as always. Before you thumb your nose at domain specific special-case languages consider the alternative approach and be grateful it does not yet have you in its clutches.

      One Final Word: Debugger.

    10. Re:Marketing 101 by metamarmoset · · Score: 1

      Using someone else's framework, I have to fix my bugs, and someone else's bugs too.

      The motto of NIH!

      Yes, you get buggy frameworks which are to be avoided. There are also many quality frameworks and toolkits available.
      If it is commecially supported, then it is someone else's task to fix any bugs you point out.
      If you built the thing from the ground up, then it's all on you (and you probably took years just getting there.)
      If it is open source, then realise that you are benefitting from everyone else's contributions and thus stop whining and go ahead and fix someone else's bug.

      Rome was not built by one man. :)

    11. Re:Marketing 101 by Anonymous Coward · · Score: 0

      You are a child programmer, right? Cause 'anything else that happens behind the scenes require no learning, support, fixing, bug reports, testing, or really any attention at all' tells me you haven't done any real world programming. Hell, man, even a child programmer should know better.

    12. Re:Marketing 101 by s.petry · · Score: 1

      That was hysterical, well done!!

      --

      -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

    13. Re:Marketing 101 by dentin · · Score: 1

      I have a vast pile of libraries that I wrote myself because frameworks are buggy as hell.

      --
      Alter Aeon Multiclass MUD - http://www.alteraeon.com
  3. Re:I thought that we were supposed to be pro-activ by Anonymous Coward · · Score: 1

    Hello, Paul. How are we doing this evening? ;)

  4. History repeats by Anonymous Coward · · Score: 0

    We used to make websites by regenerate all html pages when the database changes. It delivers really fast then.

    1. Re:History repeats by jc42 · · Score: 4, Interesting

      We used to make websites by regenerate all html pages when the database changes. It delivers really fast then.

      Yeah, that's "reactive programming" at the file level. I do it all the time, with Makefiles. Lots of people do. A nice thing about a Makefile is that you can easily control when the calculation of derivative files happens. You (re)create some sets of primary data, then use a simple "make" command to rebuild everything that depends on any of them.

      This is yet another illustration that the perps who introduced this supposedly-new concept have mostly just found a new buzzword for an approach that has been reinvented repeatedly in the past.

      One of the ongoing problems in many fields of science and technology is the constant rediscovery (or reinvention if you prefer) of concepts long known by others that just use different words for the concepts.

      Actually, mathematicians long ago realized this, and have a standard term for things that are described differently but are actually identical: They're generally called "isomorphic". A classical example that's important in computers was George Boole's "Boolean algebra", invented primarily as an exercise in pure logic. Eventually people noticed that it was isomorphic to the "propositional calculus", and then as electricity became widely available, engineers found that their new "circuit switching calculus" was another isomorphism. That's why so many programming languages have those AND, OR, XOR, NOT, etc operators.

      This crowd is merely giving us another entry in the rather long list of isomorphic systems that differ only in their terminology. This means time wasted re-developing your system from scratch, when you could have saved a lot of time if you'd only realized that others had already solved your problem for you. But we don't have a good way to discover that two systems described with different words really are the same thing.

      (Or do we? Maybe some mathematical linguists are working on the problem right now, and we don't realize this because we don't recognize their terminology.)

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    2. Re:History repeats by jythie · · Score: 2

      Given how much anti-education rhetoric combined with fads and agism I see in technology, it seems like tech is worse then most fields about reinventing the past. There seems to be an almost pathological desire to not acknowledge when something is a revisit of an older idea. Maybe too much ego wrapped up in being original?

    3. Re:History repeats by Anonymous Coward · · Score: 0

      Not only that, anything that is picked has already been discarded though experience. Cloud, thin clients, whatever this deadlock hell garbage is.

    4. Re:History repeats by bondsbw · · Score: 1

      Yeah, that's "reactive programming" at the file level. I do it all the time, with Makefiles. Lots of people do. A nice thing about a Makefile is that you can easily control when the calculation of derivative files happens. You (re)create some sets of primary data, then use a simple "make" command to rebuild everything that depends on any of them.

      But that isn't reactive; it's still polling.

      Reactive is the opposite of polling. E.g. if you wanted Makefiles to be reactive, your filesystem would need to notify when a change occurs, and then that change would immediately cause a compile (or whatever it is in your data calculation case) of only the pieces that are directly affected by that, and so on up the chain until the final result is produced.

      If you have to type "make [...]" or set up a cron job, you aren't doing reactive.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    5. Re:History repeats by stoborrobots · · Score: 2, Interesting

      Yeah, that's "reactive programming" at the file level. I do it all the time, with Makefiles. Lots of people do. A nice thing about a Makefile is that you can easily control when the calculation of derivative files happens. You (re)create some sets of primary data, then use a simple "make" command to rebuild everything that depends on any of them.

      You've hit it exactly - they've "invented" Makefiles for database rows.

      In a sense, that didn't exist before, so that's something new, and it's definitely simpler than writing the 200 lines of code to do what make would automatically do for you.

      I'm not sold on it taking over the world, but it's an interesting application of the idea.

      (Well, actually, it did exist before - they point out the example of a spreadsheet, which does exactly what they're talking about. This seems to be the answer to "why can't we program databases the same way we do spreadsheets and Makefiles?")

    6. Re:History repeats by stoborrobots · · Score: 0

      If you have to type "make [...]" or set up a cron job, you aren't doing reactive.

      That's a little disingenuous - there will always be a tool in the chain whose job is to continually check for changes and trigger the recalculation. Whether that tool is a cron job or a trigger in a db, or a specially built "reactive" engine, something is doing that job.

      Your filesystem notifications or DB reactions are either coming from a polling loop in the FS/DB engine, or from an event processing loop in the FS/DB engine. Externalising that loop into a cron job doesn't change what it is.

      Reactive programming amounts to writing a 10 line Makefile which is "automatically" (i.e. set up by someone else) called by inotify/FSEvents or by cron, instead of writing a 200 line shell script to watch a directory for changes and call gcc and/or yacc when needed.

    7. Re:History repeats by bondsbw · · Score: 1

      Your filesystem notifications or DB reactions are either coming from a polling loop in the FS/DB engine, or from an event processing loop in the FS/DB engine.

      The system calls you use isn't the question. It's about how your implementation works, not about external implementations you don't control.

      Let's think hierarchically. Make is smart and will check all intermediate output, all the way down to the leaves of its target tree, to see if it needs to do anything. If all the leaves are older than the final output, make doesn't do anything. If a level 5 leaf is younger than the final output file, make reevaluates that leaf and its level 4 parent, its level 3 grandparent, etc. to the top. It will use any intermediate outputs that were already generated where possible.

      Here's where reactive is different: true reactive programming would being at the level 5 leaf that changed, as a direct result of it being changed. No continuous polling loop would be used in your implementation (again, the OS implementation is external to this). Such a "make" would not even need to make any check on the file modification date/time. It would know that the file it is notified about will always be the direct reason for causing a recompile, and it would go up the tree to produce its intermediate outputs as well as the final output, just like normal make.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    8. Re:History repeats by Darinbob · · Score: 1

      There is an anti-learning bias I think. More and more programers who think the past was stupid and not worth studying, with languages that only old irrelevant people learned, and system designs that are irrelevant for today, and theorems and equations that are hard and difficult and thus to be skipped.

    9. Re:History repeats by Anonymous Coward · · Score: 0

      Dude, I had DOS compilers in the early 90's that did this, they called in "Online Compilation". Somehow with all the unix hero-worship, since online compilation was NIH in the unix world, the idea was discarded like so many good ideas destroyed by the Unix cult's NIHism.

    10. Re:History repeats by Anonymous Coward · · Score: 0

      No it's a different algorithm:

      In your inotify Makefile example:

      1. Some program calls inotify on all the files in the source set.
      2. When inotify indicates a file change, it executes make -f $makefile
      3. Make reads the toplevel makefile
      4. Make walks the filesystem tree, inquires the mtime of every source file and every object.
      5. for each recipe which is dirty, make executes the recipe, potentially invoking make recursively.

      This results in a massive amount of work checking file entries which aren't dirty, and executing recipes recursively for files that *could* be stale.

      In a real constraint propagation example (which is what this "Reactive Programming" seems to be a reinvention of):

      1. A program calls inotify on the set of source files.
      2. On notify, it looks at the source file's constraints, and rebuilds it.
      3. It then walks the constraint tree, recursively rebuilding or relinking objects which either depend on that source file or the object file.

      The difference here is that the tree is walked down from leaves to root, by propagating what has been damaged by rebuilding, starting at the source file. With Make, even triggered in an automatic fashion, it still walks the tree from the root to the leaves, pruning branches only when it can be certain those branches contain no dirty leaves, resulting in a massive amount of unnecessary work, that is avoided in the later scenario by using the knowledge provided by the notify event.

      It gets better, when you have an online compiler (one that keeps the internal state between compilations), you can then track changes to the code function by function or statement by statement, and recompile on the fly. The amount of code that needs recompilation with each edit in an online compiler is usually so negligable that the user will never perceive a compilation happening. I used to use compilers that worked this way in DOS, though it seems to have gone out of fashion as computers have got faster and compilers slower. For large code-bases like Linux and Webkit, I really wish I had an online compiler today.

    11. Re:History repeats by Garridan · · Score: 2

      When would I find time to read when I'm already so busy inventing?

    12. Re:History repeats by Anonymous Coward · · Score: 0

      With all your posts combined you are closely approaching "most words written without actually saying anything".

    13. Re:History repeats by Anonymous Coward · · Score: 0

      No continuous polling loop would be used in your implementation (again, the OS implementation is external to this).

      I don't think any language with events implements them with polling loops.
      Ever heard of callback functions?

    14. Re:History repeats by T.E.D. · · Score: 1

      This crowd is merely giving us another entry in the rather long list of isomorphic systems that differ only in their terminology.

      Hey, if it gives the marketing folks a way to keep themselves busy, while I get to keep doing things the same way as always, it sounds like a win for everyone.

    15. Re:History repeats by jc42 · · Score: 1

      Yeah, that's "reactive programming" at the file level. I do it all the time, with Makefiles. ...

      But that isn't reactive; it's still polling. ... you have to type "make [...]" or set up a cron job, you aren't doing reactive.

      So who said anything about typing "make"? It's quite common for, e.g. a web CGI program to start a "make" process after the client input has been written to the appropriate files. The CGI program can then proceed or exit, and make's updates will happen in the background. It's also not uncommon to see Makefile commands of the form "cd some/dir; make foo" as part of the update process.

      This isn't materially different from a write/assign triggering a cascade of updates via some routine deep down in the system library or OS. Its main advantage is that it gives the programmer better control of exactly when the updates are triggered. In the languages I use for CGI (bash, perl, tcl, python) it's also easy to check for the completion of the "make" process, and you can also get the error messages if you need them. My investigation of "reactive" libraries didn't spot any way to do this, though I could easily have missed it.

      Aside from syntax, a set of Makefile entries are conceptually similar to the rules used in a "reactive" language. Which is better probably depends mostly on your application.

      I don't remember ever setting up a cron job that does makes, but I'd imagine it could be a practical approach in some cases, when it's not important that the updates be done quickly. I do have one web site that I'm responsible for where the CGI processes finish by checking their process id, and if it's a multiple of 100, run "make clean" to clear out old log files, etc. But this isn't really the same thing. In perl, it's a one-liner: system 'make clean &'.

      OTOH, I have seen an annoying problem with a low-level "reactive" tool: Suppose that A depends on B, C and D. If all three change, this tends to trigger three updates of A that overlap. This is at best a waste of CPU time, and it can lead to race conditions in complex dependency trees. Using the "make" approach, if the changes to B, C and D are done by a single process or a set of communicating processes, it's easy to delay the update until all the leaf data has been written, when a single update process can do all the updates. This is much easier to program correctly. Of course, a well-designed reactive library might provide ways to control this, but the result would probably be isomorphic to the "make" approach.

      (And firing up a "make" process isn't cheap. It could be useful to have an equivalent process running permanently, with updates triggered by an inter-process message. But this is merely an efficiency gain; it's still logically equivalent to a "make" command.)

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    16. Re:History repeats by Hognoxious · · Score: 1

      You've clearly never heard of Bennet Haselton.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  5. Does it handle dupes? by istartedi · · Score: 3, Informative

    How does RP handle dupes?

    I know I put in my $0.02 previously, so I won't bother again.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:Does it handle dupes? by bob_super · · Score: 1

      So your reaction is to have proactively addressed the topic?

    2. Re:Does it handle dupes? by Anonymous Coward · · Score: 0

      Agreed. No idempotency and the other thing is a lack of audit artifacts, unless he's logging events within the Database layer.
      Database shouldn't be logging parameters and stuff. That's clearly application stuff.
      Stuff like this would be a nightmare to audit :(

  6. All methodologies are the same. by hamster_nz · · Score: 5, Insightful

    1) The proactive, forward looking teams adopt it first, and have great success.

    2) The "emerging trend followers" hop on board, and have reasonable results.

    3) The rest of the industry follow and have mixed results, without it being any more successful than any other methodology.

    Don't be blinded - initial results always look very promising.

    Anybody around here remember Jackson Structured Programming The initial OOP wave? The whole CASE moevement? GUI application builders that were supposed to end the need for programmers?

    The golden rule is that "whatever methodology technology you choose, half of adopters will always get sub-average results". The question you have to ask yourself Is are your team smarter than the average team?

    1. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      Anybody around here remember Jackson Structured Programming [wikipedia.org] The initial OOP wave? The whole CASE moevement? GUI application builders that were supposed to end the need for programmers?

      Yes. Yes. Yes. Yes. And some really nasty-ass "4GL" languages in there too.

    2. Re:All methodologies are the same. by Anonymous Coward · · Score: 1

      Careful about using the word average.
      It is quite possible that a small subset gets it all wrong & skews the results:

      Take the set {10, 9, 8, 9, 8, 9, 8, 8, 10, 1, 2}

      The number of members is 10
      The sum is 74
      The average is 7.4

      80% of the members of the above set are above average.

      It is quite possible that 80% of people get over-average results if you have one or two data points that skew average.

    3. Re:All methodologies are the same. by Lehk228 · · Score: 1

      not if you use median for average

      --
      Snowden and Manning are heroes.
    4. Re: All methodologies are the same. by Anonymous Coward · · Score: 0

      I have a _mean_ solution for that problem

    5. Re:All methodologies are the same. by maxwell+demon · · Score: 1

      If you use median, it's median, not average.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    6. Re:All methodologies are the same. by Anonymous Coward · · Score: 1

      Depends on who you talk to. It used to be that "average" could refer to any of several measurements that looked at the central tendency of a distribution, including median and mode in addition to mean. There seems to be more of a trend teach that decades ago though, so it is more common with older people with math background or even just grade school math, while people now are mostly taught that mean and average are synonyms. And not to be confused with when mean included things like geometric and harmonic mean...

    7. Re:All methodologies are the same. by msobkow · · Score: 4, Insightful

      Absolutely.

      The longer you spend in programming, the more you realize it's all been done in years past and it's just some "new grad" thinking they've invented something because they never looked into the history of programming techniques used over the years, or because they never happened to touch the systems that did it before.

      I've been programming for over 35 years.

      I've come to the conclusion that it's all about marketting buzz-words and bullshit to try and sucker investors into spending money, not about actually improving the way people write code or think about problems.

      --
      I do not fail; I succeed at finding out what does not work.
    8. Re:All methodologies are the same. by hamster_nz · · Score: 1

      All distributions are assumed Gaussian untl proven otherwise, as they will be a sum of a large number of random events. :-)

    9. Re:All methodologies are the same. by hibiki_r · · Score: 4, Interesting

      Like every other question about software development, we should always start with The Mythical Man Month. In this case, the relevant chapter is There Is No Silver Bullet.

      Now, the interesting thing about that chapter is that, while it was right, it was the least right of all the good predictions Brooks made. No technology is a silver bullet, but many produce noticeable improvements that, when put together, can give us an order of magnitude in productivity over older tech. It's not as if OO has been abandoned. Case tools were replaced by the far more sensible powerful IDE. GUI builders are not used a lot nowadays, but we get many of their gains by having dev environments with tighter feedback loops. And there's of course the mother of all improvements, which is the creation of large, powerful libraries. How many of the things that people did for business applications 15 years ago are, today, just replaced by libraries?

      Not that this denies your final thesis though: Hire bright programmers with people skills, and do your best to keep them. No technology will allow bad developers to make a good application.

    10. Re:All methodologies are the same. by fisted · · Score: 1

      then it's the median, but hey, let's try it:
      {1, 2, 8, 8, 8, 8, 9, 9, 9, 10, 10}
      2/11 (~18%) are smaller than the median.
      5/11 (~45%) are larger than the median.

      so you're wrong while you're wrong.

    11. Re:All methodologies are the same. by dwater · · Score: 1

      It still means that.

      'older people'? I'm 48, so perhaps it is changing...

      --
      Max.
    12. Re:All methodologies are the same. by lgw · · Score: 4, Insightful

      The nice thing is after 10-15 year or so, all problems start to look familiar to you, but not so much to the young guys or the managers. You can either rebel against the latest old thing new again and seem a Luddite, or seem a genius for immediately seeing all the pitfalls and optimizations entailed in the "new" idea.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    13. Re:All methodologies are the same. by Immerman · · Score: 1

      Yes, but in most any setting where everyone in the room knows that there are more kinds of averages than the arithmetic mean and uses them regularly, they will still probably only use the unadorned term "average" to mean just that - unless context dictates that some other average is implied.

      Go ahead - tell any mathematician, statistician, etc to "calculate the average of these numbers" with no option for further clarification, I bet you at least 90+% return the arithmetic mean - not because there's no other options, but because if any other average were meant it would probably have been specified for clarity.

      Cooking analogy - if a recipe calls for sugar you will probably be best off using a medium-coarseness cane or beet sugar with a 50/50 glucose/fructose distribution - not because there aren't hundreds of different types of sugar with different flavor profiles and cooking properties, but because if they meant one of those other kinds the recipe would have called for "______ sugar", the fact that it did not implies that they meant the common usage - plain, ordinary table sugar.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    14. Re:All methodologies are the same. by dbialac · · Score: 1

      I'm actually looking at this one to a degree as an example of how not to build scalable database systems.

    15. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      Yes, I do remember JSP, and II have to say it worked for me. But I always recognised that other members of th team simply didn't need that approach.

    16. Re:All methodologies are the same. by socode · · Score: 1

      "Although we see no startling breakthroughs, and indeed, believe such to be incompatible with the nature of software, many encouraging innovations are under way. A disciplined, consistent effort to develop, propagate, and exploit them should indeed yield an order-of-magnitude improvement."
        -- Brooks

      I can't agree this was the least right of all of his predictions - he said exactly what you intimated he was wrong about. On that, he was bang on, and it's less surprising since it was an epistemological prediction. The area he was least right about was the rate of technological progress, which is much less fundamental, and therefore underestimated how quickly tools, storage, and compting speed would increase, with a consequent impact on the size of development team, production of documents, automation of testing and so on.

    17. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      +101

      To quote George Santayana: "Those who cannot remember the past are condemned to repeat it."

      One of my young colleagues once refused to believe that there was ever such a thing as a magnetic tape ...

    18. Re:All methodologies are the same. by WuphonsReach · · Score: 1

      I started programming in the late 80s, went professional / full-time after about 15 years of hobbyist level programming (COBOL, Fortran77, Pascal, CA-Clipper / DBase III/IV, C, C++, VB, Java, JavaScript).

      OOP with the concepts of public functions and private variables is a big step forward in terms of the compiler being able to check your work. For anything where you are passing around complex business objects, some sort of OOP is necessary.

      In the Java world, there are add-ons (Spring Roo) which simplify the definition of "business" objects. It handles a lot of the "grunt" work of defining plain old java objects (POJOs) by using AspectJ. With AspectJ being able to inject methods rather then defining them in your source code, you gain a lot of simplicity in your business objects. So that bit of CASE has come true, but at a limited scale.

      Frameworks are another step forward. For many problem spaces, there are huge amounts of setup/teardown and communication needed to get stuff done. Having a good framework lets you abstract a lot of that out of your systems, letting you focus more on the business objects.

      The open source movement and the advent of open source frameworks, languages, compilers, editors, and IDEs has also been a big paradigm shift. In order to build software for OS/2, I had to purchase something like a $300-$500 compiler, plus manuals, plus a UI framework. Now I can get a full fledged IDE in the form of NetBeans, Eclipse (or SpringSource Tool Suite), or a few others.

      I don't miss the days of COBOL and Fortran77. Things have definitely improved over the decades.

      --
      Wolde you bothe eate your cake, and have your cake?
    19. Re:All methodologies are the same. by Hognoxious · · Score: 1

      Yes, but in most any setting where everyone in the room knows that there are more kinds of averages than the arithmetic mean and uses them regularly, they will still probably only use the unadorned term "average" to mean just that

      Really? If I say our neighbours are "just an average family" I don't mean they have a non-integer number of members.

      I'd say the laymen's conception is closer to the mode.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    20. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      Any armchair statistician can produce a retarded distribution to produce an arbitrary result.

      Nature has better things to do.

    21. Re:All methodologies are the same. by maxwell+demon · · Score: 1

      In that case you actually mean "typical", which isn't really caught by either arithmetic mean or median, but corresponds more to maximum likelihood.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    22. Re:All methodologies are the same. by voidphoenix · · Score: 1

      Average: a measure of central tendency. Mean, median and mode are different ways of measuring central tendency, i.e., they're 3 different kinds of average. Mean is just one kind of average.

    23. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      Arithmetric or geometric mean?

    24. Re:All methodologies are the same. by lwriemen · · Score: 1

      You have to also realize that probably over half of software developers are willfully ignorant and therefore incompetent, which is why technology promotion on /. looks like a good path to larger acceptance.

    25. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      Go ahead - tell any mathematician, statistician, etc to "calculate the average of these numbers" with no option for further clarification,

      I'm the AC you are replying to an not so coincidentally also a mathematician. I do agree the vast majority would calculate the mean when you ask or describe something as the average, and it is how I default to using average in most generic math contexts (some situations naturally imply other things though). Nonetheless, there is still a noticeable, but shrinking breed that uses it to mean something more general. And it is kind of important to be aware of this when reading texts and papers, both old and some still being written, even if not being prescriptive with that use.

      Yeah, your cooking analogy works in a sense, but if you are going to get into cooking you need to be aware there are other kinds of sugar and that some recipes don't spell things out. Or you learn that hard way eventually with an occasional recipe, not just because the texture is different, but because the volume measurements for table sugar and icing sugar are different.

    26. Re:All methodologies are the same. by cyborg_zx · · Score: 1

      What is he, a foetus? Magnetic tape is still around.

    27. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      Yep, I've been aroudn the block, too. And here's the one no-so-secret thing I've learned (that managers refuse/don't want to believe):

      The only way to sucessfully write software is to have the right people writing it.

      Which doesn't only apply to software, it applies to nearly all endeavors. You need the right people to get the job done. And no methodology will save you if you have the wrong people.

    28. Re:All methodologies are the same. by Anonymous Coward · · Score: 0

      From someone who doesn't really know what they're talking about, could it be that the "forward looking teams" adopt it because it fits what they're doing. "Everyone else" just picks it up because it worked for someone else.

  7. Woohoo by viperidaenz · · Score: 5, Insightful

    Yet another super awesome framework/system/language/whatever to make a shopping cart in as few lines as possible.

    The someone tries to build something remotely complex and it all falls to shit and the code ends up as spaghetti.
    The guy who built it then leaves the company and they can't find anyone else with the skills to understand how it works

    1. Re:Woohoo by Anonymous Coward · · Score: 0

      Is that a dig at Paul Graham?

    2. Re:Woohoo by LordWabbit2 · · Score: 1

      All software ends up a bloated pile of cr@p eventually
      UNLESS
      You have policies in place to prevent it (like code reviews) as well as no quick fix's, rush jobs, or hacks.....
      Yeah right! Never worked in a company like that Ever!
      Maybe the guys who get to code stuff like satellites and Mars rovers get the luxury of time to get things right/perfect

      Nevermind did a quick google.
      Bug 1
      Bug 2

      --
      There are three kinds of falsehood: the first is a 'fib,' the second is a downright lie, and the third is statistics.
  8. Does not matter by Anonymous Coward · · Score: 0

    The problem is not the model, but the idea that one size fits everything.

    And the biggest problem is that the management, and very often the developers are unable to switch between the different approaches.

    It is simple, you want something fast and dirty, and right now? REACTIVE

    You got the market, and now is time to make your product stable and reliable? SWITCH TO CONVENTIONAL.

    As simple as that.

  9. Re:I thought that we were supposed to be pro-activ by icebike · · Score: 1

    Point proven.

    --
    Sig Battery depleted. Reverting to safe mode.
  10. should've tried Twisted by smoothnorman · · Score: 2

    what it takes to implement business logic using Reactive Programming versus two different conventional procedural Programming models: Java with Hibernate and MySQL triggers,'

    ...Twisted/python is perhaps a more sensible established comparison for event-driven, or not. besides... "business logic"?

  11. A Day at the Country Fair by MightyMartian · · Score: 5, Funny

    Buzz words! Get your red hot buzzwords! These buzzwords are fresh folks! No one's even figured out what they mean yet! You snooze, you lose! You there, little boy, I bet you could use Web 3.0!

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
    1. Re:A Day at the Country Fair by similar_name · · Score: 4, Funny

      I bet you could use Web 3.0!

      I'm going to wait for Web 3.11 for Workgroups.

    2. Re:A Day at the Country Fair by girlintraining · · Score: 1

      I'm going to wait for Web 3.11 for Workgroups.

      Yes... because having web apps where pressing 'cancel' on a login screen sounds like a great idea.
       

      --
      #fuckbeta #iamslashdot #dicemustdie
    3. Re:A Day at the Country Fair by Anonymous Coward · · Score: 0

      It's two words, fucktard.

    4. Re:A Day at the Country Fair by ignavus · · Score: 1

      You there, little boy, I bet you could use Web 3.0!

      Web N is so passé. Web N+1 is much better.

      There. I have achieved eternal oneupmanship.

      --
      I am anarch of all I survey.
  12. spreadsheet by Anonymous Coward · · Score: 0

    Sounds like the spreadsheet engine has grown up!

  13. table based programming by phantomfive · · Score: 3, Interesting

    Isn't reactive programming essentially a repackaging of Table Oriented Programming?

    --
    "First they came for the slanderers and i said nothing."
    1. Re:table based programming by istartedi · · Score: 1

      I'd step back even further and say it's a repackaging of wiring things together. Once we got away from magnetic cores and punched-cards, wiring things together wasn't modeled in code very much. If all of that were really great, we would have already been doing more spreadsheet and/or circuit-simulator based programming. That's not to say it doesn't have some nifty applications. Aren't there some cool GUI front ends to audio processors that work that way?

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    2. Re:table based programming by msobkow · · Score: 2

      Table-oriented programming strikes me as a fancy name for something much older: data driven programming. Control structures which are pre-defined as "tables" of data that get interpreted at run-time.

      --
      I do not fail; I succeed at finding out what does not work.
    3. Re:table based programming by phantomfive · · Score: 1

      I'd step back even further and say it's a repackaging of wiring things together. Once we got away from magnetic cores and punched-cards, wiring things together wasn't modeled in code very much.

      That's an interesting point that I hadn't thought about. Modern programming languages kind of get away from the 'wiring things together' approach, and even make it difficult.

      Arguably though, that is how the brain is constructed.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:table based programming by fatphil · · Score: 1

      The summaries made it sound like it was just another kind of data flow paradigm. Languages like that are at least into their 4th decade now.

      --
      Also FatPhil on SoylentNews, id 863
    5. Re:table based programming by Anonymous Coward · · Score: 0

      Table-oriented programming strikes me as a fancy name for something much older: data driven programming. Control structures which are pre-defined as "tables" of data that get interpreted at run-time.

      Thanks for posting that. Very insightful description.

  14. functional by Lehk228 · · Score: 3, Interesting

    In imperative (procedural) programming, A=B+C is an assignment statement. A is set when the assignment statement executes. Subsequent changes to B or C do not affect A, unless you specifically re-calculate A. Software developers are responsible for understanding and managing these dependencies.

    Reactive programming is a declarative approach for defining logic. Variables are defined by expressions such as A=B+C, which automatically reacts to changes in B or C.

    this is just rebadged functional programming, except using deliberately confusing syntax

    --
    Snowden and Manning are heroes.
    1. Re:functional by msobkow · · Score: 1

      Actually, it's not. Functional languages do not necessarily re-evaluate expressions. Take Erlang for example.

      Rather, functional languages like Erlang explicitly do not allow RE-assignment of variables: assign once logic.

      You're thinking of an expert system, which *does* re-evaluate expressions and rules based on the dependency tree it builds up while loading the rules.

      --
      I do not fail; I succeed at finding out what does not work.
    2. Re:functional by msobkow · · Score: 1

      Most functional languages are rather a way of expressing multiple function signatures and having the run-time decide which is the best match based on the parameters at run-time, not compile-time.

      --
      I do not fail; I succeed at finding out what does not work.
    3. Re:functional by bondsbw · · Score: 2

      Not entirely. Of course you can model A=B+C as a function A which, when evaluated, returns the sum of B and C. And sure, you can evaluate A() several times and get different results if B or C have changed.

      Reactive programming is about the future and expecting change. When B or C changes, notification of that change is pushed up to the eventual recipient.

      But it's more than just simple event handling. For example, what if you wrote a complex SQL query against a few dozen tables located on a hierarchy of servers that might only return a handful of joined records out of millions or billions? And what if that data rarely changes, but you need to know almost immediately? Polling would use too many resources, too much bandwidth, and may never give you the results in a timely manner. But if the system is reactive, the change starts at the leaf server and only gets propagated up its part of the server hierarchy to the final listener. And if that record is filtered out somewhere along the way? The remaining part of the server hierarchy (including the end listener) never has to know or worry about it.

      Still, reactive programming is a hammer but not everything is a nail. Use it when it helps.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    4. Re:functional by Anonymous Coward · · Score: 0

      more like just a state machine using a spreadsheet macros or database triggers

    5. Re:functional by Anonymous Coward · · Score: 0

      Wrong, just wrong.

    6. Re:functional by Anonymous Coward · · Score: 0

      Reactive programming is a declarative approach for defining logic. Variables are defined by expressions such as A=B+C, which automatically reacts to changes in B or C.

      this is just rebadged functional programming, except using deliberately confusing syntax

      And we all know how well this works to make reliable code in spreadsheets...

    7. Re:functional by bondsbw · · Score: 1

      Most functional languages are rather a way of expressing multiple function signatures and having the run-time decide which is the best match based on the parameters at run-time, not compile-time.

      You should be stripped of your 5-digit ID for that statement.

      You just described duck typing, while the opposite (static typing) is typically encouraged in functional languages.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    8. Re:functional by lgw · · Score: 2

      Or, one could call it "push based, instead of pull based" if one were eschewing obfuscative nomenclature.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    9. Re:functional by fatphil · · Score: 1

      I first encountered in "data flow" languages. And you're right, diminutive words are comparatively superior.

      --
      Also FatPhil on SoylentNews, id 863
    10. Re:functional by msobkow · · Score: 1

      I don't claim to know all functional languages. That's why I qualified my statements with "Erlang", which happens to be a well known language that is classed as "functional."

      And it is most emphatically not statically typed.

      --
      I do not fail; I succeed at finding out what does not work.
    11. Re:functional by msobkow · · Score: 1

      Higher level functional specifications are like generics. They match some generic set of parameters regardless of the types of the parameters. They then invoke other functions, some of whose overloads specify types, and usually a generic fallback.

      Until run-time, there is no information about what the generics passed to that higher level function are, so there is no way to use static typing from compile time analysis.

      Another aspect of some functional languages is that they make it easy to pass generically signatured functions to a generic algorithm. As long as the passed function takes n parameters, it can be passed and invoked by the generic algorithm, such as a comparison for a sort. Once again, there is no knowing what the types of the actual arguments will be until run time.

      I therefore say you're full of shit and don't know what you're talking about, or have a very narrow view of what "functional" means.

      --
      I do not fail; I succeed at finding out what does not work.
    12. Re:functional by VortexCortex · · Score: 2

      Not entirely. Of course you can model A=B+C as a function A which, when evaluated, returns the sum of B and C. And sure, you can evaluate A() several times and get different results if B or C have changed.

      Reactive programming is about the future and expecting change. When B or C changes, notification of that change is pushed up to the eventual recipient.

      So let me get this straight instead of polling the keyboard and mouse port constantly, with Reactive Programing we can just have them generate an interrupt which calls a handler and it calls functions which calls functions to propagate this state change event into other waiting batches of code until the end result is generated -- Updating a cursor location or activating keystroke command, etc. Wow, that's pretty revolutionary. Someone should invent the shit out of that so that the CPU can just sit on a HALT operation until something actually happens.

      Or we can just stick to calling it Event Driven Programming and be fucking done. The Controller updates the View when data in the Model changes? You don't say.

      But it's more than just simple event handling. For example, what if you wrote a complex SQL query against a few dozen tables located on a hierarchy of servers that might only return a handful of joined records out of millions or billions? And what if that data rarely changes, but you need to know almost immediately?

      Well in that case I just have the controller update a distributed data model that's broken down according to its views. The problem with pure reactive approach is that you can't efficiently run a SQL across the distributed data model unless you thought to prearrange the system for it -- If you did think ahead, then you didn't need reactive programming to accomplish it. If you use a purely Reactive Programming Language and platform then you'd still have to re-deploy the system every time you want to include a new query.

      That's why distributed DBs with replication already exist so that you can deliver, say, Google+ notifications to nearby friends in near real-time while allowing those not explicitly interested to search for the data later after the cached data replication occurs. See? Folks already thought about the bandwidth problem of the "reactive approach"... A Reactive Programming language essentially does the job of a network and database engineer, and you can bet it'll make some dumb assumptions unless these employees are maintaining the implementation of the back-end framework that exposes the event controller and data model to the RP language anyway (which seems to be the case in TFA). No real win over handing a data flow diagram to a couple of coders who will implement it anyway, except with a formalized language you've added another layer of abstraction and thus another layer of mystery between the programmer's desires and the end result -- "Let's put People in the Compiler! What can possibly go wrong?!"

      So, basically RP just not storing storing the data in a central location (Polling) and delivering the data as it arrives (Event Driven). Smalltalk and Squeak already exist, so it's not like we need a new language for calling functions in response to .onChange() -- No, you really should take a look at Squeak if you haven't already. I mean, I'm all for reinventing the wheel when needed, but can't we just rename Squeak to (re)Active++ Enterprise Edition and skip this headache?

    13. Re:functional by Anonymous Coward · · Score: 0

      But it's more than just simple event handling. For example, what if you wrote a complex SQL query against a few dozen tables located on a hierarchy of servers that might only return a handful of joined records out of millions or billions? And what if that data rarely changes, but you need to know almost immediately? Polling would use too many resources, too much bandwidth, and may never give you the results in a timely manner.

      Why would anyone implement a poll-based event handler? From all you are writing it sounds to me like you once wrote a horribly bad event handler, then rewrote it the way it should have been written in the first place and decided to call it something else than an event handler.

    14. Re:functional by msobkow · · Score: 1

      In short, the whole point of a functional language is to express generic algorithms and procedures in terms of generic types. To re-use the logic of one specification across a swath of data types.

      While you could express multiple overloads of the algorithms, each specified in terms of specific types, that would be missing the whole point of functional programming.

      --
      I do not fail; I succeed at finding out what does not work.
    15. Re:functional by VortexCortex · · Score: 1
    16. Re:functional by bondsbw · · Score: 1

      Again, when you resolve types at runtime, that's called duck typing. The statement I replied to:

      Most functional languages are rather a way of expressing multiple function signatures and having the run-time decide which is the best match based on the parameters at run-time, not compile-time

      is simply wrong. There is nothing, absolutely nothing, about functional languages that requires duck typing. And like I said, many functional languages discourage or even eliminate runtime type resolution.

      And if your hangup is on the fact that I use the term "type" instead of "function", remember that in functional languages, functions are first class. When you create a function, it has a static type. That static type is typically evaluated by the compiler.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    17. Re:functional by Anonymous Coward · · Score: 0

      I think you spuriously imply there's a single point to functional programming. For instance, nobody would claim that Haskell isn't a functional language; yet its typeclass system permits exactly what you describe as "missing the point."

      Might be better to claim that there are many idioms that are naturally expressible with various FP language features; generic programming could be viewed as one of those.

    18. Re:functional by Anonymous Coward · · Score: 0

      Uh, except that there are lots of dynamically typed functional programming languages that permit or even wallow in runtime polymorphism and generic programming, such as much of the Lisp-derived family of languages. CLOS, the Common Lisp Object System *loves* (and practically originated) multimethod dispatch, for example.

      While CLOS is arguably more OO than "functional", using generic functions with runtime dispatching is a common pattern in functional programming in Common Lisp -- it is one of the ways by which cross-implementation portability is most commonly achieved. Some of these are used on really very pure functions, for example when calling out to highly-optimized foreign (i.e., non-Lisp) purely-functional code that is optimized for some niche environment knowable only at runtime thanks to things like dynamic libraries or one-program-multiple-real-and-virtual-hardware-platforms.

      Moreover, runtime selection of dispatch is somewhat orthogonal to static vs dynamic typing. Runtime selection of functions can be found in GHC (usually selecting by type) and even more regularly in Generic Haskell, Clean, and friends.

    19. Re:functional by Anonymous Coward · · Score: 0

      GP's "best match based on the parameters at run-time"

      Perhaps should have been said as "... the environment at run-time", rather than the parameters given to the function itself.

      However, dispatch can certainly be done on the parameters given to the function itself without engaging in anything but the strictest of static typing. Generic programming selecting on types is a reasonably common pattern in Haskell, which is about as far from your sense of "duck typing" as you can get.

      http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/generic-programming.html

  15. The great coroundrum by TrollstonButterbeans · · Score: 1

    This article summary ends "And no doubt this discussion may raise other questions on extensibility and performance for Reactive Programming.' Do you agree?""

    But a superior ending would be "Don't you agree?"

    Because any response to "Don't you agree?" is better for marketing FUD because any potential answer ("Yes", "No") can be interpreted with being in agreement with the leading question?

    (This comment is revelvant specifically because the term is "Reactive programming" is a worthless marketing buzzword and I am staying on-topic discussing how to improve superior ambiguity. And I can argue it is revelvant because "revelvant" is not a word and can have any retroactive intended meaning! So double the value of this post in the marketing department!)

    --
    Priest: "Universe from nothing, no laws of physics, sped up time"+ huge discrepancies. Creationism? No. Big Bang Theory
    1. Re:The great coroundrum by Anonymous Coward · · Score: 0

      Superior even still would be a much more slash-editor-likely "don't you not agree?" ;-)

  16. Differs because it isn't a type of programming by Anonymous Coward · · Score: 0

    This is commonly known as creating a reusable framework and does absolutely nothing to change programming, of which database programming is only a small part anyway.

    Another great trolling headline from Slashdot.

  17. my question: by globaljustin · · Score: 1

    Yet another super awesome framework/system/language/whatever to make a shopping cart in as few lines as possible.

    yeah...see this is true, and my question is WHY?

    this happens predictably (at least for any rational person who looks at how this part of the computing industry changes over time)

    someone tries to build something remotely complex and it all falls to shit

    but still people spend good time/money, sometimes lots of a few people's time, to make another and the cycle starts over again

    is it possible to interview for a company, or be the head 'coder' during a major decision time for a new client or product, and just say, "No, from a coding perspective this is theoretically possible but it can't be done. This is bad design and we can code something that has this function and meet our quality standards."

    can that happen?

    --
    Thank you Dave Raggett
  18. Re:I thought that we were supposed to be pro-activ by Anonymous Coward · · Score: 0

    Absolutely...there's not nearly enough RFC 6921-compliant applications.

  19. Junk science by Anonymous Coward · · Score: 1

    Articles like this really annoy me. There are so many things wrong, it's hard to decide where to start. He concludes in favour of reactive by comparing java and mysql complete with all white space, comments and declarations, with a few bullet pointed reactive expressions in order to fluff up the numbers as much as possible. He makes no attempt to give a balanced viewpoint and makes conclusions based on false statistics and insignificant results. I've seen many so-called experts write junk like this to promote whatever their shiny new API is over the years. Most of them have ended up in limited edge systems, maintained by developers who would rather be doing anything than dealing with the nightmare.

    Reactive might be a good idea, but I'm tired of dealing with people sucked in by junk science like this.

  20. Toy Example by reluctantjoiner · · Score: 3, Interesting
    I'm trying not be as automatically dismissive as others, but this example isn't convincing. If your enterprise can be encapsulated by eleven use cases, any framework will suffice. But even in this toy example, we can some obvious missing things.

    For example, the "Purchase Order" entity includes a reference to a sales rep. From it's inclusion we infer that is important data, so it would also need to be added as a "reaction". There's also no hint on how these "reactions" are actually implemented. The original article claims that consistency is enforced but doesn't really explain why.

    The customer.balance Rx, specified for the place order use case, states that its value is the sum of the unpaid order totals. This expression is automatically reused over all transactions that use the field. So, the balance is increased if an order is added, decreased when it is deleted or paid, increased when you raise the quantity, and so forth. With imperative code, it is easy to overlook one of the use cases introducing âcorner caseâ(TM) design and coding errors. Reactive practically eliminates this class of error.

    The above might be what they mean, but that's not sufficient for consistency. If your database field is merely a duplicate of derived data in other entities, you shouldn't pat yourself on the back for avoiding a problem you created in the first place! You can also overlook a use case in the analysis phase too, and then you'll fail to include it regardless of the framework.

    I think I'd like to see an example with all the entities included and some normalisation. Then maybe I might be convinced that RP has any advantages over triggers.

    1. Re:Toy Example by FalleStar · · Score: 1

      It also doesn't help that he's clearly trying to exaggerate how complex this simple logic would be in other programming languages. The "500 lines of Java code" is mostly whitespace, curly braces, and comments. When you remove the comments from the code he provides while keeping the generous line-spacing, it's only 275 lines of code.

    2. Re:Toy Example by sjames · · Score: 1

      Equally troubling is the screwy premise. In most cases, once the PO issues the price is fixed. Reacting to changes in product.price would be incorrect. That's the whole reason for having a product_price field in lineitem. If that isn't the case, then as you say the duplicate is self-inflicted damage. I also don't see why you would ever reassign a line-item row to another product, you toss it and create a new one.

      I know it's hard to present a complete example in a neat little package, but when I see an example this contrived I have to wonder if the new greatest thing can be justified in a non-contrived example.

    3. Re:Toy Example by locofungus · · Score: 1

      What has me particularly troubled is that it talks about amount being sum(items*price) while in the "Just five lines of reactive programming" it has

      Derive credit_limit as sum(purchaseorderList.amount_total where paid=false)

      As far as I can tell, this allows people to order as much stuff as they like, and only when they try to pay for it will it be blocked.

      On the positive side, if someone has ordered 10000 widgets at $10 then the sales rep decides to have a 2 for the price of one offer for the next 50 customers, the price change will be blocked because the previous orders will now not incur enough credit drawdown any more.

      And while I have seen cases where the new price is honoured when the price is dropped after an order is placed but before it is shipped, I've never heard of companies wanting to change old purchase orders that are bought and paid for after the event. It's a wonderful sales tax fraud - ship your goods, then discontinue them and reduce the price to zero. Now when you do your query to find out the total sales it's zero and there's no tax to pay.

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
  21. This is rules based programming by greg_barton · · Score: 1

    See JBoss Drools, JRules, Blaze, etc.

  22. Nothing to see here by rootmon · · Score: 1

    This is nothing new. You can wrap up the complexity of the code in a toolkit/framework/library but this is just functional programming driven by events. Nothing to see here. Move along. Don't believe the hype.

    --
    "As flies to the wanton boys are we to the gods; they kill us for sport." - William Shakespeare, King Lear
  23. what "Reactive Programming" really is by Gravis+Zero · · Score: 3, Informative

    from what i've read on wikipedia, "Reactive Programming" is really just function as a variable with caching.

    example:

    c = 5
    b = 4
    a = b + c
    print(a) // outputs 9
    c = 6
    print(a) // outputs 10

    this isnt rocket surgery

    --
    Anons need not reply. Questions end with a question mark.
    1. Re:what "Reactive Programming" really is by Anonymous Coward · · Score: 1

      I'm a C# programmer by day, and I don't see the hype either. It's been available in C# for years now, and with no need for events or event handling or triggers or any other temporal foolishness.

      In your pseudocode example, c and b are variables, and a is a delegate that takes no parameters and returns an int (or something that int can convert to, barring further detail). Using C# lambdas, the line a = b + c would be written as a = (b, c) => b + c.

      But you're right, it's really just a function pointer and some syntactic sugar to make it all stick together. Definitely not rocket surgery.

    2. Re:what "Reactive Programming" really is by Prien715 · · Score: 4, Funny

      from what i've read on wikipedia, "Reactive Programming" is really just function as a variable with caching.

      example:

      c = 5
      b = 4
      a = b + c
      print(a) // outputs 9
      c = 6
      print(a) // outputs 10

      this isnt rocket surgery

      c=a + b ...behold the infinite loop is born!

      --
      -- Political fascism requires a Fuhrer.
    3. Re:what "Reactive Programming" really is by Anonymous Coward · · Score: 0

      this isnt rocket surgery

      Thank goodness for that. There's never a rocket surgeon around when you need one.

    4. Re:what "Reactive Programming" really is by Anonymous Coward · · Score: 0

      The term "Reactive programming" covers vastly more than the humble function pointer.

      You say that what you've written is a is a delegate that takes no parameters. But a delegate with no parameters is written () => using lambda syntax in C#. You have (b, c) => which specifically says that the delegate takes two parameters - one referred to as b, and one as c. Hence your delegate could not be used in a reactive system as is, you'd have to wrap it in something that the rest of the system could use without having to always know what values to use for b and c, and without always knowing to call it as a function expecting two parameters.

      Which is to say - your example does not even touch the concept of reactive programming, any more than it touches the concept of moon rocks. Where's lazy evaluation? Where's deferred updates? Where's dependency tracking? Where's variable chaining?

      I'm not saying that RP isn't going through a bit of hype at the moment. I actually believe there's a bit of meat on the bone here, but it's not revolutionary - I see it as making the components of an event-driven system first class citizens in the programming model, such that "reactive" variables are primitives which can be treated the same way as ints. That is, it's a way to cut out a lot of boiler plate observer pattern / event registration / lazy evaluation code and bury the complexity of a large event-driven system.

      Is that useful? I don't know. What I do know is that you don't know either. It's highly possible that you "don't see the hype" because you don't understand it, based on the example you presented here. Just saying.

    5. Re:what "Reactive Programming" really is by Anonymous Coward · · Score: 0

      It might not be rocket surgery, but it's pretty obvious even from this simple example that any time saved "writing lines of code" will be seriously surpassed by time spent "debugging this massive function where values defined several screens before the error occurred keep changing due to side effects of this terse syntax with implicit rather than explicit functionality".

      Call me a stuck in the mud traditionalist if you like, but it's instantly evident to me that as soon as mediocre to poor programmers get their hands on this stuff, the buggy incomprehensible stuff they produce is just going to get vastly worse.

    6. Re:what "Reactive Programming" really is by dkf · · Score: 1

      behold the infinite loop is born!

      Good. Any language that can't do an infinite loop is rubbish.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
  24. Spreadsheets are lousy programming models by putaro · · Score: 5, Interesting

    Their presentation makes analogies between "reactive programming" and spreadsheets and specifically references the power of "chaining" to have multiple functions firing as the result of changes.

    There are a number of issues with this kind of event chaining that you run into as you get past the toy cases.

    1) Fan-out. How many actions are being kicked off by a simple change?
    2) Latency - this is a direct corollary to the fanout. Are all of the chained functions being run synchronously? If so, what happens when someone introduces a very slow function that gets run as the result of a user input. So the user changes the price of a part and every purchase order in the system is suddenly being updated?
    3) Synchronicity - of course, as soon as you find out that your synchronously run chained functions slow things down you start running them in the background. Now, you have a problem where you don't know if something is up-to-date or not. And, in this model, it's not possible to find out if something is up-to-date.

    The examples that they gave are very poor use cases for triggers even. Most general ledger systems I've looked at, running on top of a database, would just recalculate the balance on demand. If your database is large enough that the recalculation starts to take significant time, you cache the result and invalidate it using a trigger. Most GL systems typically make entries much more frequently than they need to calculate the balance for an account. If the recalculation of the balance takes significant time, you probably don't want to do it every time an entry is made anyhow.

    1. Re:Spreadsheets are lousy programming models by Krishnoid · · Score: 1

      Their presentation makes analogies between "reactive programming" and spreadsheets and specifically references the power of "chaining" to have multiple functions firing as the result of changes.

      Sort of an off-topic question -- why is Excel the chosen programming 'language'/model for non-programmers? Are there design concepts that come into play to assist the non-programmer or any human when you lay out your data/variables visually?

    2. Re:Spreadsheets are lousy programming models by Entrope · · Score: 1

      I would guess because a spreadsheet makes dealing with variables -- both scalars and arrays -- easy, where "dealing with" includes data reduction, visualization and editing. Derived values are updated automatically, you can trivially pull up at least a few common visualizations, and the software includes a solid library of basic statistical and other mathematical functions. I am a professional programmer, proficient in GNU Octave in addition to various compiled languages, but the reasons I listed are why I use a spreadsheet for most of my one-off analyses of small(-ish) data sets.

    3. Re:Spreadsheets are lousy programming models by Lemmeoutada+Collecti · · Score: 1

      That's pretty much the summary of why I use them, as well as to initially organize sample data sets so I can quickly rearrange and visualize them. But as anyone who has attempted to use Excel to calculate a result on a million plus row spreadsheet knows, automatic calculation quickly becomes an enemy of the state - it slows to a crawl as the data sets grow or the calculations become more complex than just sum/average/etc.

      Another post above points out the cause of the issue - one change can kick off a fanning of calculations, and each calculation can kick off another fan out. Loops are also easy to create, so I wonder how RP deals with those.

      --

      You can have it fast, accurate, or pretty. Pick any 2.
    4. Re:Spreadsheets are lousy programming models by Capt.Albatross · · Score: 2

      I was about to add 4) Unstable cycles - the formula your program represents may not be satisfiable, in which case it can never settle down to a consistent set of values.

      If that is the case, however, then either your problem is not solvable or your model of it is faulty, and the program implementing it would be wrong whether it used reactive programming or not.

      This suggests a partial solution to the synchronicity problem: whenever the event queue is empty, you have a consistent solution. This is OK for spreadsheets, but it seems to raise problems for a multiuser database with concurrent updates.

    5. Re:Spreadsheets are lousy programming models by Anonymous Coward · · Score: 0

      How about recursion? Or even without recursion, various race conditions or other problems caused by combining expression chains of various lengths or latencies?

    6. Re:Spreadsheets are lousy programming models by D-Duff · · Score: 1
      As with any programming concept and languages, almost every benefit that is gained introduces drawbacks. Some of those drawbacks can be solved, and others we just have to live with. At the end of the day, it's all about picking the right tool for the job and in some cases, the spreadsheet/reactive model is the right tool.

      Spreadsheets are computer programs where the typical user doesn't usually care about the problems you mention as long as he gets the correct results.

      The pros and cons I had from my reactive programming experience are:
      Pro 1) Terse code: My typical defect/kloc remained about the same. So by using about 10x less code to do the same job, my defect count went down proportionally.
      Pro 2 ) Live development: No need to stop/compile/start to change a rule, so it's possible to view the result of a rule change quickly. (this also leads to Con 1: Capacity to screw up)
      Pro 3 ) No need to repeat formulas: Applying a formula to all the rows in a spreadsheet is tedious.
      Pro 4 ) Complex Relationships: It's quite challenging to implement complex object relationships using spreadsheets as each object requires its own worksheet.
      Pro 5 ) Data Visualization Tools: Reactive rules encourages developers to clearly layout their data and a good tooling suite can allow developers to visualize everything.

      Con 1 ) Capacity to screw up: With live rule editing, a mistake in a rule could get evaluated instantly and potentially corrupt the application data beyond repair. This can be partially solved by good development practices such as taking backups during development.
      Con 2 ) Fan Out: As the parent mentions, how many rules are triggered on a data change? This can be solved this using static analysis of the rules to figure out a triggering graph.
      Con 3 ) Latency/Synchronicity: A good infrastructure can enable developers to define rules that synchronous, asynchronous or delayed execution. It's also possible to have an infrastructure that allows developers to monitor the cascade of execution. However, each change is executed through event triggers. A large number of changes leads to a large number of events which adds overhead. It wouldn't be a good idea to program a video game with this for instance.
      Con 4 ) Large Data Set: Changing a reactive rule on a large data set might lead to a chain of event that takes a large amount of time to execute compared to a customized SQL script that would perform the change in a single batch.

  25. Horseshit. by pigiron · · Score: 3, Insightful

    Stored procedures and triggers are already here and I see no evidence that there is anything new here. If the database is in a correct normalized form this will not reduce the amount of code one iota.

    Do ***NOT*** put this sort of logic in the application code. Use properly written stored procedures, foreign key constraints, and database triggers and don't let "application" programmers (especially not agile ones or those who invent new terminology for well known and previously solved problems) within 100 miles of the logic.

    And as far as the users being able to understand it "better" I have only one word to say: Bwahahahahahahahahahaha!

    1. Re:Horseshit. by dwpro · · Score: 1

      Indeed, it's shocking that anyone ever chooses a language or platform other than the database for doing complex application logic. Certainly couldn't be a limitation of the tools or languages available in the DB, those are top notch for every business case.

      --
      Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. -- Susan Ertz
    2. Re:Horseshit. by pigiron · · Score: 1

      It's absolutely insane to recompile the entire fucking application every time a line item in an invoice gets updated or even moved to a different invoice. The young morons who program today haven't a clue about the power of the relational model when it comes to transaction processing and ACID transactions.

      You calculate the totals at query time not when you are updating a single instance of a column fer chrissakes! NOSQL, star schemas, and the like are for reporting copies not live on-line systems.

      The example given doesn't even require a trigger at all just and insert or update statement in a stored procedure. People have to learn the power of databases to abstract the data layer from the application layer and user interface.

  26. Isn't this SQL? by Anonymous Coward · · Score: 0

    To me, the whole idea is already well addressed within the SQL language. You're either talking about setting up a good definition of business rules for your data (DDL) or creating another way to look at your data (Views).

    While there is room for improvement in the way that SQL defines (and especially exposes) the final definition, it's so far down the path to what the authors contemplate that I don't see why taking a different approach makes any sense. Maybe handle this information at the interface between the database and the application(s)?

    The example logic provided would be very valuable information for SQL's Query Optimizer to have in planning how to execute statements. At large volumes of customers, it becomes very important to consider the performance impacts of defining and enforcing logic - you always should (to the best of your resources and ability).

    During the age of NoSQL: have people forgotten about the benefits of the tool that was 'holding them back'?

  27. Taming CRUD? Only half way by Tablizer · · Score: 1

    I've been looking at ways to make CRUD applications "declarative" using almost nothing but data dictionaries (field tables) and attributes. It can be done for relatively simple and controlled scenarios, but if you have unanticipated requirements or are stuck using an existing database that has built up years of baggage/cruft, then it requires custom interventions.

    CRUD is conceptually relatively simple, but the devil's in the details and those details can really be devils.

    Yes, you can simplify CRUD by making certain presumptions. However, if you have to violate those presumptions, then your clean abstractions take a big hit to the nuts and the fixes are messier than what you'd get hand coding most of it from scratch or from minimalist libraries.

    That appears to be "trick" used here: when your scenario lines up nicely with your framework's assumptions, the framework handles most of the grunt work like magic. It's essentially a circus trick for the naive.

    Until the day CRUD is somehow finally fully tamed with a great framework that handles all the goofy needs of specific shops, my preferred compromise is to use "smallish" abstractions, AKA "helper routines" that can optionally be used to simply things, but are NOT required. I like to say you need a way to: date your abstractions, but not marry them.

    And these components have sub-components that can be partially used as needed also so that I only have to reinvent 1/3 of the wheel if I can't use the whole component. That way real-world requirements that "break" my larger-scale abstractions don't entirely boot me out of the framework (to be left hand coding all the details) because I can still use most of the smaller-scale abstractions that the bigger ones were built out of. It's kind of a fractal "next resort" down the abstraction ladder.

    It's not perfect, but a decent compromise between hand-coding all from scratch and (alleged) do-it-all frameworks (like TFA) that are not flexible. But, you do have to know the parts well.

    1. Re:Taming CRUD? Only half way by Bite+The+Pillow · · Score: 1

      date your abstractions, but not marry them.

      Can you screw your abstractions and forget to call them later? Do you have to use Gates condoms or will sheepskin work? What if your abstractions become pregnant? Is the offspring concrete? Should you have just prevented the problem by going with an int-er-face?

    2. Re:Taming CRUD? Only half way by weilawei · · Score: 1

      Libraries, not frameworks.

    3. Re:Taming CRUD? Only half way by Jeremi · · Score: 1

      Can you screw your abstractions and forget to call them later? Do you have to use Gates condoms or will sheepskin work? What if your abstractions become pregnant? Is the offspring concrete?

      I think you have the genders switched -- in this analogy, you're the woman. In particular, the abstraction is the boyfriend who can walk away scot-free if things don't work out, and you're the one who is stuck with an 18-year support obligation.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    4. Re:Taming CRUD? Only half way by Tablizer · · Score: 1

      The line is blurry between them. Libraries for CRUD generally require or expect certain conventions be used. These conventions create a "framework" of sorts. But there are "controlling" frameworks and "voluntary" frameworks (for lack of a better term). Controlling frameworks control the "main" function(s) and flow, limiting you to writing event handler-like snippets.

      Voluntary frameworks give you sample "main" function(s), and detail libraries, and let you use or ignore what you want. Controlling frameworks hand-hold you more, reducing human error and often coding, but are also less flexible if the framework doesn't handle what you need.

  28. Re:I thought that we were supposed to be pro-activ by bondsbw · · Score: 3, Informative

    Ok, there are a lot of people commenting on this below who have absolutely no idea what reactive programming is about. So I'll try to clear it up a bit.

    Reactive programming is not polling.

    If you call a function and wait for it to return a result, you aren't doing reactive programming.

    If you are working in a REPL or command-line environment, and you have to type a command every time you want to obtain a result, your system is not reactive.

    Reactive programming is not events and triggers. Well... let's say it this way: reactive programming is to events/triggers as writing in [C/C++/Java/C#/Haskell/etc.] is to writing in assembly. In other words, you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    Events and triggers are typically used when a little reactivity is needed. When you build your system around reactivity, using events and triggers quickly becomes inefficient and you need something built for the task. You would pick a reactive programming language or framework for such a complex job, just like (most of) you would choose high-level languages and frameworks over assembly for building a social media website.

    Reactive programming isn't an agile framework. It's not some new way of describing object-oriented programming. And it's not the right tool for every job, but for some jobs, it's the perfect tool.

    --
    All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
  29. Amazingly stupid and fluff article by enigmatic · · Score: 1

    That is one of the least informative articles I have read in a long time.
    In fact I feel dumber for having read it.

    It picks numbers out of thin air for the "standard programing" model,
    then it has some magic pixie dust that represents the result in
    reactive programming as a few lines of code.

  30. Or Logic Programming (Re:Isn't this SQL?) by Capt.Albatross · · Score: 1

    I was thinking along the same lines, except that I would say 'relational' rather than 'SQL' because SQL is neither the only nor the ideal implementation of the relational model.

    In one significant way they are different, however. Part of Codd's insight was that the deductive power of his model should be less than Turing-complete, so that issues of undecidability don't arise (triggers were not part of Codd's model.) This restriction made automatic query optimization and reasonable transaction times feasible, while those (relatively few) problems requiring the power of a Turing machine could be handled in a Turing-equivalent host language.

    In contrast, the proponents of 'reactive programming' seem to be wandering into the realm of logic programming, which has been around for at least 4 decades (Prolog), without giving any indication that they are aware of its pitfalls.
     

  31. QML is like this by Anonymous Coward · · Score: 0

    I've been learning QML (Qt's declarative markup language) and it works this way.

    Values for properties of UI elements are expressions that can refer to other elements' properties. When the values of the properties in the other elements change, this element's property's value changes as well.

    1. Re:QML is like this by scorp1us · · Score: 1

      Yes and no. Really its just javascript callbacks. The QML system is just giving you a framework of automatic callbacks. At the core it works a lot like nodejs

      --
      Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
  32. Re: I thought that we were supposed to be pro-acti by KramberryKoncerto · · Score: 2

    Just like OOP eventually breaks down into CPU instructions, and you can use any Turing complete language to implement anything, I think he has a fair point. It sounds like a way to design a language so that complex event/trigger type stuff are easier to implement and debug systematically, perhaps using a slightly different way of thinking. It might not be a fancy thing, but I don't think there's anything wrong about giving it a name.

  33. Re:I thought that we were supposed to be pro-activ by bondsbw · · Score: 2

    Don't kid yourself that it isn't fundamentally a style implemented with events.

    I suppose that's why I said:

    ... you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    --
    All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
  34. Re:I thought that we were supposed to be pro-activ by blackraven14250 · · Score: 1

    It's a level of abstraction. If the only difference is that a "reactive" paradigm allows you to write the same code in less lines, each of which is less complex, it's an improvement over creating events/triggers. I don't know whether that's actually the case, but if it is, the above applies.

  35. Under the Bus and Over this Reactive BS.... by Anonymous Coward · · Score: 0

    It looks like most any comments on that article get pruned pretty quickly. Post a thoughtful critical comment and watch it disappear.

    Also, who in their right mind would want to obfuscate all of their business logic across a number of database tables? Sure, maybe it's less code but if it's not something that can be understood by someone other than the original developer, it has little long term value. Developers get thrown under the bus all of the time, I say write your code (and use "clean reading" technologies) as if it were to literally happen and some poor soul needs to try and pick it after.

    I'll take 100 lines of readable code over 5 lines of obfuscated bullshit any day.

  36. This is absolute bullshit. by vikingpower · · Score: 2

    I don't know Val Huber, but can judge his "technology" ( hardly worth that name, though ) by what he is doing: putting the logic of a server-side application inside an RDBMS. After years and years of Hibernate applications with abysmally bad mainainability, now that finally finally finally-thank-god there are mature no-SQL databases, this guy goes back to where we were in the 80s.

    Moreover: comments on that article simply get suppressed. Which says enough about this guy's capability to sustain critical thought. Dupe. Total dupe.

    --
    Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
  37. Re:Software Industry by Anonymous Coward · · Score: 0

    Lead, Follow or get out of the way!

  38. re-bullshit of the moment by znrt · · Score: 1

    try this with any real-world problem beyond this simplistic example and you'll be so deep in a mess that you'll yearn to have even COBOL back.

    also good luck becoming familiar which such a codebase (er, trigger base) after just 3 months worth of iterations. the only reason for such an approach to imply "reduced maintenance" is that it would be absolutely unmaintanable. real world apps don't have 500 loc, they have more like 500k. good luck grasping the behaviour of a system staring at 200k worth of triggers. so now, good boy, go ahead and change just one of them and be fascinated by the impact. oh, these kids with their brand new macs ... i lov'em, they are soooo funny and they make us old hacks soooo indispensable! :-)

  39. Re: I thought that we were supposed to be pro-acti by Anonymous Coward · · Score: 0

    Give it as many names you like, but bondsbw is on a posting spree trying to convince people that reactive programming languages doesn't have to us CPU cycles to call functions.

  40. Re:I thought that we were supposed to be pro-activ by davester666 · · Score: 1

    They were handing out the blue pills, not the tasty yellow ones. So, not so good.

    They make me feel like I've been chewing on aluminum foil for an hour.

    --
    Sleep your way to a whiter smile...date a dentist!
  41. Re:I thought that we were supposed to be pro-activ by serviscope_minor · · Score: 2

    ... you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    I kind of get the diretion you're going in, but I stil don't see. can you give an example? I see your analogy about C++ versus assembly but I only really understand it because I nuderstand C++.

    Presumably reactive programm automates some (how/what?) or many or most of the difficulties away...

    --
    SJW n. One who posts facts.
  42. Is it webscale? by Hognoxious · · Score: 4, Insightful

    You've told us what it isn't. That's as much use as telling us that strawberries are not yellow and curved.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    1. Re:Is it webscale? by Jmc23 · · Score: 1
      Except that there are some strawberries that are yellow, and all strawberries are curved.

      So, basically his imprecision was more precise than yours.

      --
      Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
    2. Re:Is it webscale? by bondsbw · · Score: 1

      It seems, though, that most comments here are calling strawberries yellow and flat.

      If you want to know everything about reactive programming, Google is your friend. I'm just attempting to dispel the myths that seem prominent here.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
  43. Square one revisited by Anonymous Coward · · Score: 0

    But... but... last week I was supposed to do _functional_ programming, because it's so much better than procedural/imperative. And now they're telling me _reactive_ is the new hotness. Damn. I'll never get this HelloWorld done.

  44. Excel is changing it's name? by aethelrick · · Score: 1

    Sounds a lot like excel is changing it's name. I'm not sure that this programming technique is anything other than the brackety crap you type into the tiny text box at the top of an excel worksheet... you know, that thing that leaves you wanting a programming language for anything more complex than summing a column or sticking two bits of text together.

  45. Re:I thought that we were supposed to be pro-activ by Anonymous Coward · · Score: 0

    In other words, you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    You have a fundamental lack of understanding, not only of events and triggers but also of what a paradigm is. The limits you have encountered are language specific and has nothing to do with the paradigm itself and everything that is possible and efficient in "reactive programming" is just as possible and efficient in languages with proper event support. Mostly those are different variants on basic since lower level languages don't try to hide what the CPU does in that manner.

    The thing with different paradigms is that you can implement them in pretty much any programming language. You can write object oriented C or assembler. In fact that is a great way to get a structure in your code in those languages. You can write procedural code in Java and C++ and that way avoid many of the problems those languages have.
    You can write event driven code (Or interrupt driven or whatever you want to call it.) in C and assembler too. Solving the same problem in the same language but using different paradigms is a great way to point out the benefits and drawbacks of each method.
    If you somehow think that reactive programming is different from one of the traditional paradigms, then please write a concrete example on how they would be different in the same language because at the moment I am pretty convinced that you are a shill.

  46. "Enhanced Quality" by burying your business logic by AidanApWord · · Score: 1

    ... in a schema ... nice! Not.

    From the linked article:
    Enhanced Quality
    Encapsulating logic into database column definitions (across a variety of possible architecture) ensures automatic reuse of the logic across use cases.

    I nearly fell of my chair.

  47. Re:I thought that we were supposed to be pro-activ by metamarmoset · · Score: 5, Informative

    The point of new paradigms in programming languages is to make the complexity of the expression match the complexity of the idea being expressed, not the complexity of the (platform specific) implementation.

    Crappy illustration:

    C++ - Event-trigger
    vector triggers;

    void add_trigger(Trigger * t);

    void reactive_variable::modify_value(int new_value)
    {
    // event
    this.value = new_value;
    // trigger
    for (i = triggers.begin(); i != triggers.end(); i++){
    i.react(new_value);
    }
    }

    // actual code you want to get around to actually writing
    int main()
    {
    reactive_variable a;
    Trigger *b = new Trigger(COPY_VAR);
    a.add_trigger(b);
    Trigger *c = new Trigger(ADD_VAR, 1);
    a.add_trigger(c);

    a.modify_value(2);

    enter_event_loop(); // some routine that modifies a continuously

    return 0;
    }

    Incomplete, inelegant and probably buggy, but you get the picture.

    Verilog - Reactive
    assign b = a;
    assign c = a+1;

    inital a = 2;

    always @(posedge clk)
    a = count(input);

    Easy to understand whats going on and spot errors. 'b' will always equal 'a' and 'c' will always be one more.

  48. Re:I thought that we were supposed to be pro-activ by gbjbaanb · · Score: 1

    so Reactive Programming is basically syntactic sugar making event handling a bit easier.

    Fair enough... though I can't help thinking of Node.js and all those callbacks being heralded as a new revolution in programming when I hear about this stuff. As an old fart, I know there's nothing really new... just kids who think they need any new paradigm because they never had the balls to learn how the old stuff worked.

  49. Reactive Programming = COME FROM label by 140Mandak262Jamuna · · Score: 2
    We all know how bad GOTO statement is and why that is the root of all evil.

    Reactive programming is based on the totally opposite concept of COME FROM statement. Waiting for a future Dijkstra to write a paper on how evil COME FROM is.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  50. Re:I thought that we were supposed to be pro-activ by Anonymous Coward · · Score: 0

    So what you're saying is: reactive programming is to software development as zombo.com is to the web?

  51. Re:I thought that we were supposed to be pro-activ by serviscope_minor · · Score: 1

    Actually, that's a good illustration, thanks!

    Especially the bit about hardware. I guess if = just means a wire, then if one side changes, then so does the other. I guess you'd have to insert a D-latch to make it non-reacive. I guess nothing in the assignments is clocked.

    I expect with care and crazy templates you could make a reactive framework for C++ if one chose.

    --
    SJW n. One who posts facts.
  52. Been there broke that by FaytLeingod · · Score: 2

    There was once a language called magic that allowed this to be done and was really good at it. A bank wrote their system with it. Then 5 years later someone tried to re-write the banking app. 10 years later they're still reverse engineering the original app to provide the functionality.

    --
    as it is eaten so it shall pass
  53. Clever Hans by Anonymous Coward · · Score: 0

    Read the story about Clever Hans and you will see how reactive works vs proactive. You will see the flaws.

  54. Re: I thought that we were supposed to be pro-acti by Anonymous Coward · · Score: 0

    Before I read your post, I didn't have the first clue about Reactive Programming. Now I know five things that it isn't! Thanks, bondsbw.

  55. Re:I thought that we were supposed to be pro-activ by ZahrGnosis · · Score: 2

    The downside of reactive programming, however, is exactly the same as the downside of the event/trigger logic that has been available in databases for decades, namely the difficult-to-trace side-effects caused by out-of-order execution that is basically mandated in reactive programming.

    It's not so obvious when you're first writing code, but it's a headache when you're maintaining it (I disagree with the article on this point). Take the example in the original article... let's say you go back and add a requirement that people can pay for multiple invoices at once or for partial amounts. You have to check every single trigger to see if it refers back to the original payment information and adjust it accordingly. You'll have to change the data model to handle partially paid components (currently "paid" is a boolean), and any trigger that reads or modifies "paid" will have to be adjusted.

    This alone isn't a problem -- you'd have to make similar changes in OOP, procedural, or functional languages... the issue is that in those languages you're more likely to be able to trace the dependant code and understand the flow. If you have access to the entire code base, you could search it I suppose, but each trigger operates like a "COME FROM" command in INTERCAL... it's as if your code is running along operating and all of a sudden an execution branch just pops in, performs some change, and lets you carry on, without telling you. I've had to debug some brutal issues caused by this sort of programming and it's difficult precisely because you're not sure where the execution path is coming from nor in what order it's being executed. It's almost entirely un-auditable once it gets complex enough to perform real-world tasks. If this was a real-world billing system, you'd have payments, refunds, discounts, credits, and a dozen other bits each making each "reaction" more complex. Each would require its own line of reactive code and each would depend on at least several of the others, and it's very easy to lose track of what's going on.

    I realize people can write bad code in any paradigm, but bad code in reactive is far more difficult to debug, fix, and maintain, IMHO.

  56. LabView/VI by Anonymous Coward · · Score: 0

    So it's basically LabView/VI except more confusing. Just what we needed.

  57. Aspect oriented programming by Anonymous Coward · · Score: 0

    Seing the example, it came to my mind the AOP that you can use with Spring over Java, am I right or am I missing something?

  58. Re:I thought that we were supposed to be pro-activ by metamarmoset · · Score: 1
    Ok, so the assign statements are more like buffers, or D-latches with permanent enables (and yes, they are asynchronous. the always statement is clocked, though). To make it non-reactive, you would need to multiplex, or place it in a conditional block.
    I guess hardware is always reactive, you just get to decide what it is reacting to and any one point. Reminds me of a micro architecture lecture where someone asked what happens if you don't put a value on the opcode port...

    From the article, I think the idea is to enable hardware-like features to programmers.
    It's not clear (and other posts are clearly as confused about this) whether reactive programming is meant to be a language-level paradigm (which IMHO would be interesting and useful) or some kind of 'philosophy' like agile.

    If the latter, then I guess it would be about creating frameworks, which would get seriously messy, or some kind of meta-programming.

    For C++, I think Qt-style signals and slots is the best you're likely to get, since you don't need to care how the event loop and triggers work, you just 'emit' in the right places and 'connect' up whatever object you'd like to change accordingly.

  59. Exploiting ambiguity to latch onto hype by REggert · · Score: 2

    I don't know why people keep submitting this garbage from Espresso Logic, who is just taking advantage of the fact the the term "reactive" has been overloaded to mean different things to exploit the hype surrounding the Reactive Manifesto and related technologies (e.g., Akka, Rx, Node.js, etc.) to push their own, completely unrelated product, which is based on the more traditional (i.e., the one you find in Wikipedia) definition of "Reactive Programming".

    "Reactive programming", as defined by the Reactive Manifesto (which is what all the hype is about), is about designing applications that operate in an entirely asynchronous and non-blocking manner, so as to maximize CPU utilization and fully exploit parallelism, and ensure that the system is always responsive to new events (user input, incoming data streams, errors, changes in load, etc.) rather than having resources tied up waiting for external processes (e.g., blocking on I/O). It has nothing to do with "reactive databases".

    --

    cp /dev/zero ~/signature.txt

    1. Re:Exploiting ambiguity to latch onto hype by Anonymous Coward · · Score: 0

      I'm waiting for redactive programming.

  60. How is this just not callbacks? by scorp1us · · Score: 1

    This seems like the way nodejs works, where everything is done in a callback (anonymous function). Maybe you layer a triggering framework on it but that's all it is.

    This is the second "reactive programming" article and I don't think it's anything other than callbacks. Someone is trying to get PR for some paradigm they think they invented.

    --
    Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
  61. The *read deal* with "Reactive Programming by scorp1us · · Score: 1

    Both slashdot articles are authored by "ValHuber" who works at Espresso Logic Expresso Logic's web page is bannered by

    "Reactive Service for SQL Data
    RESTful API with reactive logic and security in 4 easy steps
    Dramatic reduction in development & maintenance time"

    I think it is time we stop marketing for this consulting company.

    --
    Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
  62. Why do we reinvent wheels? by frank_adrian314159 · · Score: 1

    This is just forward-chaining logic programming. I.e., if x changes then do y, and people have been using this in design for years - several large vertical applications have this feature built in.

    The problem with this kind of code is that, when there is contextual dependency on what is to be done (which happens often in real life), the code becomes riddled with special cases accessing data from far flung parts of the system to determine the contextual state - this starts to look akin to spaghetti code with everything accessible from anywhere in the program: Hello, global state!

    The other problem is that, without fixed flow of control, debugging becomes more difficult, even if you have a specialized debugger that doesn't make you trace through the machinery.

    Plus, people not used to this kind of programming will embed code which must be specifically ordered within one or more triggers not realizing that trigger orders are usually unspecified, leading to fragile code.

    In the end, this is just like any other programming paradigm - useful for things that it's useful for, not so useful for things that don't fit well. You should know how to program on systems like this. You should also know how they're implemented so that you don't screw up when you have to program in one.

    --
    That is all.
  63. Just to Clarify by aphxtwn · · Score: 1

    Is "Reactive" logic an event-driven model with reused logic for column calculations/validation?

  64. What it is. by Anonymous Coward · · Score: 0

    Making the comparison with a database implementation. I think, is very weak. A spreadsheet makes much more sense, and applying this to UI, even more sense:

    Consider a text entry (t1) with coords((x = 200, y = 300)
    and another text entry (t2) with coords(x =t1.x , y = 320)

    Then whenever I move/size the screen, t2 will stay at the same x coord as t1. I could also disable/enable the save button based on whether these text entries have anything in them (enabled: !t1.text.length.isEmpty() && ! t2.text.length.isEmpty()). Again, if the text changes, the save button is enabled/disabled... I don't send events or listen to them. The equation varies over time.

    I think DB is poor in the sense you have to know what you are listening for (register a trigger). However, imperative languages make this somewhat kludgy as well to implement. F#, Haskell, Elm make this much easier to cleanly handle.

  65. RP is the same as using global variables by Anonymous Coward · · Score: 0

    And we know the problems of global variables.

  66. Re:I thought that we were supposed to be pro-activ by oreiasecaman · · Score: 1

    You really must be an expert, because I haven't understood a damned thing by reading your explanation...

    --
    This is a UDP joke, I don't care if you get it or not...
  67. terrible article by Anonymous Coward · · Score: 0

    only a couple thing that popped out which made me stop reading:

    1. he notes he used 500 lines of code to do the same thing in java / hibernate
    i haven't used java / hibernate before so i had a peek under the hood
    in total the files he showed totalled 459 lines of code
    over half those lines are comprised of either empty lines or comments

    2. the files seem to include a number of java related base classes
    for example "import java.util.Set;"
    except it's done in all java class files
    all of which also include "import buslogicdemo.util.HibernateFactory;" and "import buslogicdemo.data.*;" which sound like custom classes
    so would you not have some upper level dummy file that includes common appropriate dependencies once instead of replicating their inclusion everywhere?

    i also had a look at this "5 lines" of code
    which is great and all. except there's nothing there to actually get data in / out of the system
    whereas the java code looks like it takes care of that

    either way, "yes" you can make updates to a database as if you were treating it like a massive excelspreasheet with multiple sheets / areas to deal with
    but given the complete lack of any identifying detail of what's going on, have fun when you make an update that accidentally generates a circular depency and effectively prevents and further access to your data while meanwhile filling up your disc til your server konks out