Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Thursday August 25 2016, @05:43AM   Printer-friendly
from the weighing-different-approaches dept.

Professional programming is hard: dealing with large amounts of data, network requests which can fail in umpteen bizarro ways, and Gordian Knot style interdependencies. And then, to top it all off, there's all those different programming paradigms to choose from.

For example, in passive programming, communication between program modules happens through public function/method calls.

In reactive programming, communication occurs through publishing events to which subscribers react.

Both styles of programming differ in how they manage state [responsibility]. Both styles differ in how dependencies are expressed. And both styles differ in the strains put on you, the put-upon, well-paid programmer, trying to construct a mental model of the code and its interactions.

In the July/August issue of acmqueue, Andre Medeiros proposes that modules employ both approaches in Dynamics of Change: Why Reactivity Matters — Tame the dynamics of change by centralizing each concern in its own module (open, DOI: 10.1145/2956641.2971330) (DX). He provides an introduction to the two approaches — their advantages and shortcomings — and then illustrates how combining the two provides a clearer presentation of state for the developer.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2, Informative) by quietus on Thursday August 25 2016, @02:48PM

    by quietus (6328) on Thursday August 25 2016, @02:48PM (#393039) Journal

    Yeah, you missed something (you are, ofcourse, not alone in just skimming the article -- after all, this is the interwebbythingy we're passing electrons back and forth on).

    The whole article is about [code] maintainability. Reactive programming is a natural fit if you've got some async functionality [network requests, data loading] in your program, and your language allows it. The author argues that it should be the default style of programming [if possible], as you can read what the module does directly in code. With 'passive' programming however, you'll first have to trace the different function/method calls -- i.e. check out the functionality in other modules -- before you can completely understand a single module's functionality.

    Now, even if you work by default in reactive style, you'll encounter situations where 'passive' programming is a more natural fit -- think a centralized data store with its own built-in methods, or any other synchronous action. Where, [when] and how to combine both styles within the same module so as to get to cleaner, more elegant, hence more maintainable code, is what the article is about.

    Starting Score:    1  point
    Moderation   +1  
       Informative=1, Total=1
    Extra 'Informative' Modifier   0  

    Total Score:   2