3 ms·
Views have logic, sometimes very complex logic. If views are not allowed to have "code" in them, or are functionally crippled in some way, then presentation log
by extension 15y ago
Views have logic, sometimes very complex logic. If views are not allowed to have "code" in them, or are functionally crippled in some way, then presentation logic is probably going to get mixed in with the domain model, because there won't be any other place to put it. The programmer needs to have complete discretion in where they draw the line between domain and presentation.
This codeless view mythos arose because HTML includes a lot of rich interactive capabilities, and it's tempting to declare that these capabilities are all you will ever need in your presentation layer, but that is arbitrary and false.
In most other contexts, e.g. GUI programming, a codeless view is nonsensical. Code is everywhere. And if it's difficult to write nice view code, that's likely a problem with your programming language and/or your APIs.
Also, don't conflate model/presentation separation with server/client separation. Ideally, they are orthogonal concerns. To create the best UX, your views, and possibly your models, will have to straddle the network.
In short, don't let your technology stack dictate how you modularize your application.