Many of the reasons people give for software being unscalable are organisational or related to code comprehension. The usual argument goes: the application is delayed because the developers need time to reason about the codebase, or to restructure. It’s actually more personal than that though; a coder can provide a dozen temporary fixes a day, writing quick and dirty code. What we’d be doing, however, is condemning real solutions to being implemented only at the end of the rainbow, because the return journey to those real solutions would now be so tedious, many would simply choose to focus on new problems rather than the old ones. That’s why we separate view and model from the start: not because better structure means faster coding, but because it means funner coding. Among many things, frontend development speed is a function of how much fun the frontend team is having.
What makes frontend fun? For the optimists, there’s unit and e2e testing. For the perfectionists, there’s static typing (TypeScript and Flow). For the realists, that static typing is actually optional. The tendency to separate ‘view’ and ‘model’ are rooted in the time-tested ‘divide-and-conquer’ approach, an approach so fun it spawned a whole genre of games: strategy. TypeScript and selenium (for e2e testing) are now used heavily in the production of Webio’s unified frontend for business.
TypeScript’s object-oriented paradigm has not only slashed the length of our codebase, but it has really helped us achieve a system of modular and distinct behaviours that aligns with how we picture things in an abstract way. Frontend behaviour relating to bots is related to a Bot object, and so on. The reason coders employ MVC or MVVM or whatever new approach people concoct, is the same reason we like to have separate sections for forks, knives and spoons in the cutlery drawer, why we eat starter, main and desert separately rather than in one big bowl. Not only must a developer understand their code, and know their way around, to be as effective as possible they should be having fun writing it.