Andrey (azangru) wrote,

For a reason that escapes me, the twitterverse has been praising the talk titled React is Fiction from the last ReactConf. The speaker there starts by saying that writing components is similar to writing fiction, which follows the "show don't tell" golden rule. A (hypothetical) example that she gives from fiction is:

"She is tired" (tell)
"Her footsteps are heavier than before, the weight increasing as she trudges towards the bed, collapsing head-first onto the mattress" (show)

So far so meh.

But then she does the impossible. She suggests that the "tell" from her example (i.e. what not to do) is similar to "imperative programming", while the "show" (what to do) is declarative. Which just makes my blood boil, because "she is tired" is literally, fucking, declarative. It’s up to the function, or component, or whatever, to have an actual implementation of tiredness, but the interface of the component will only need to be told that she is "tired". As opposed to supplying the component with all the details of showing tiredness: footsteps equals heavy, direction equals towards bed, fall type equals head-first collapse...


  • (no subject)

    Two clips left a particularly deep impression on me over the last couple of days. One is Pelosi's reply to a journalist: Not the first of her…

  • (no subject)

    Is the CNN making the point for Bret Weinstein (transmitting the message of Geert Vanden Bossche)? So strange to see.

  • (no subject)

    The blame game that DiBlasio plays in this clip is disgusting. Instead of saying, we, your leaders, were wrong; we miscalculated; we thought that the…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.