14 Matching Annotations
  1. Jul 2020
    1. The key to successfully creating reusable components using both render props and scoped slots is being able to correctly separate behavior from presentation. Each time you create a new UI component, think “What is the core behavior of this component? Can I use this anywhere else?”
  2. May 2020
    1. The task of "making a thing satisfying our needs" as a single responsibility is split into two parts "stating the properties of a thing, by virtue of which it would satisfy our needs" and "making a thing guaranteed to have the stated properties". Business data processing systems are sufficiently complicated to require such a separation of concerns and the suggestion that in that part of the computing world "scientific thought is a non-applicable luxury" puts the cart before the horse: the mess they are in has been caused by too much unscientific thought.

      Dijkstra suggested that instead of concerning ourselves with a software system that meets the user's needs, we should first separate our concerns.

      We should first concern ourselves with the user's needs and draw up careful specifications – properties to which the system should adhere should it satisfy the user's needs.

      With those specifications in hand we can concern ourselves with making a system guaranteed to have stated properties.

      The problem with this thinking, which the software industry would later discover, is that a user's needs cannot be accurately or completely determined before building the system. We learn more about what is needed by the process of building.

      This is an instance of the [[Separation of concerns]] not working.

      This is also why the industry has settled on a technique to build iteratively (Agile), always leaving the option open to change course.

    2. Some time ago I visited the computing center of a large research laboratory where they were expecting new computing equipment of such a radically different architecture, that my colleagues had concluded that a new programming language was needed for it if the potential concurrency were to be exploited to any appreciable degree. But they got their language design never started because they felt that their product should be so much like FORTRAN that the casual user would hardly notice the difference "for otherwise our users won't accept it". They circumvented the problem of explaining to their user community how the new equipment could be used at best advantage by failing to discover what they should explain. It was a rather depressing visit.... The proper technique is clearly to postpone the concerns for general acceptance until you have reached a result of such a quality that it deserves acceptance. It is the significance of your message that should justify the care that you give to its presentation, it may be its "unusualness" that makes extra care necessary.

      When you've developed an idea, you will typically want to communicate that idea so that it can be understood and used more generally. Dijkstra calls this reaching "general acceptance".

      To do so, you must communicate the idea in a way so that it can be properly understood and used. For certain ideas this becomes a challenging problem in and of itself.

      Many forgo this challenge, and instead of figuring out what new language they need to invent to most accurately communicate the idea, they use legacy language and end up communicating their idea less effectively, in pursuit of general acceptance.

      Dijkstra says that the proper way of dealing with this dilemma is to separate your concerns. You separate your concern of the solution from the concern of communicating the solution.

      When you've reached a solution that is of such high quality that it deserves communicating – and only then – do you concern yourself with its presentation.

    1. presentation was nearly always considered separately, rather than being embedded in the markup itself
    2. This concept is variously referred to in markup circles as the rule of separation of presentation and content, separation of content and style, or of separation of semantics and presentation.
    3. First proposed as a somewhat less unwieldy catchall phrase to describe the delicate art of "separating document structure and contents from semantics, presentation, and behavior"
  3. Dec 2019
  4. Nov 2019
    1. React Native has also used this pattern in TouchableWithoutFeedback
    2. we use a LOT of injector components to abstract out logic and nicely separate concerns like style, animation, and interactions from our layout components.
  5. Oct 2019
    1. Rack middleware is more than "a way to filter a request and response" - it's an implementation of the pipeline design pattern for web servers using Rack. It very cleanly separates out the different stages of processing a request - separation of concerns being a key goal of all well designed software products.