In my web development journey I quickly saw the advantage of the separation-of-concerns principle. Separate HTML CSS and Content layers not only made developing & maintaining for the web immensely faster & easier, it made the previously-impossible possible. I’ve considered this a bedrock development principle for many years, but then yesterday I watched this video of Pete Hunt talking about React:
It’s ~30min, but it’s dense. It gets to the point quickly and doesn’t let up (I♥ engineers).
He quickly expands on the idea of separation-of-concerns, explaining that it’s really meant to influence software development in two ways;
- Reduce coupling. This is how much the different parts of your software are interlinked. If you make a change in once place, how many other things change? Coupling is what makes software hard to maintain.
- Increase cohesion. How much the parts of any module belong together? For example all the CSS declarations in a single CSS file instead of in-line styles all over the place. Cohesion makes software easier to maintain.
Why is this important? We’re constantly reengineering our development methods, and currently we’ve been evaluating several Web templating frameworks like Handlebars, Echo, Dart and others. Templating offers some great features, but still gave me a tip-of-the-tongue worry I couldn’t quite articulate. I think Pete’s right that while templating is in the spirit of separation-of-concerns, it’s actually a separation of technology, splitting up the same concern; DOM modification. This increases coupling and decreases cohesion.
React is very impressive. I’m going to kick the tires a bit over the holiday break and see what it’s like.