DEV Community

Mike Sandula
Mike Sandula

Posted on

Separating ourselves from the separation of concerns

I like to cook, but I always find the following type of instruction frustrating:

Once the onions have softened, add the cumin, oregano, and chili powder.

How much cumin, oregano, and chili powder? I have to flip back to the ingredients list to check. I’d much rather see:

Once the onions have softened, add the cumin (2 Tbsp.), oregano (1 Tbsp.), and chili powder (1/2 Tbsp.).

This would save me from bouncing between the ingredients and instructions, especially if I’m using my phone. Even with a physical cookbook, the constant context switching breaks my flow—a problem familiar to software engineers.

This is similar to another problem familiar to software engineers: the separation of concerns. The separation of concerns is a design principle that suggests keeping distinct aspects of a system separate for clarity, such as the Model-View Controller pattern where data (the model) is kept separate from the UI (the view), with a controller in the middle linking the two.

When React introduced JSX, there were concerns that this syntax violated this principle. In time, however, most came to see that JSX only violated a separation of technologies. I had a similar aversion to Tailwind the first time I used it—I still don’t love it—but I definitely don’t miss always needing a CSS file open in addition to its corresponding JSX/TSX file.

Makes you wonder whether there are any other "separations of concerns"—in coding, cooking, or anything else—that are false distinctions we’ve been clinging to.

Top comments (0)