

It's not - the hard part is maintaining the code.

#ONE UI BROWSER CODE#
We still talk about programming as if typing in the code was the hard part. This leads to useless conversations about semicolons and whether we need a preprocessor that eliminates curly braces. Programmers are obsessed with ease rather than simplicity (thank you Rich Hickey for making this point) or, what the experience of programming is instead of what the resulting program is like. The architectures used in single page apps represent the result of this process: where you would do things in an ad-hoc way using jQuery, you now write code that takes advantage of standard mechanisms (e.g. Usually, this proceeds by noticing recurring patterns and replacing them with a mechanism that does the same thing in a consistent way - replacing a lot of "case-specific" code, which in fact was just there because we didn't see that a simpler mechanism could achieve the same thing. Good code comes from solving the same problem multiple times, or refactoring. It is possible to write code without understanding the problem fully that code is just more complex than it needs to be because of our lack of understanding. Our implementations tend to outpace our understanding. Most projects start with high ambitions, and an imperfect understanding of the problem at hand. This is achieved by separating the data from the presentation of data by having a model layer that handles data and a view layer that reads from the models. Single page apps are distinguished by their ability to redraw any part of the UI without requiring a server roundtrip to retrieve HTML. Server-side rendering is hard to implement for all the intermediate states - small view states do not map well to URLs. menu open, menu item X selected, menu item Y selected, menu item clicked). Supporting rich interactions with multiple components on a page means that those components have many more intermediate states (e.g. This is hard to do with other approaches. Why do we want to write single page apps? The main reason is that they allow us to offer a more-native-app-like experience to the user.
