Why I don't do MVVM.
-
But MS says it better.
Quote:
... The issue with the MVVM pattern is that it can inadvertently lead to apps that have too many layers and too many allocations. ... But strict adherence to any variation of the pattern can lead to apps with a lot more overhead than can be justified. ... consider putting event handlers in your code-behind ....
[MVVM and language performance tips - UWP applications | Microsoft Learn](https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/mvvm-performance-tips)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
I'm shocked--shocked, I tell you--that MSFT would give a tinker's cuss for performance. For as long as I can remember, it doesn't matter what the hardware folks do to speed up CPUs or increase memory and disk space, because most of the software folks frivolously piss it away. I get the sense, admittedly somewhat superficially, that web-based applications in particular are absolute pigs in excrement when it comes to performance. Does performance still even matter?! If it does, and I wasn't retired, I'd be sorely tempted to find and work with folks who were aiming to blow all of this crapola out of the water.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
But MS says it better.
Quote:
... The issue with the MVVM pattern is that it can inadvertently lead to apps that have too many layers and too many allocations. ... But strict adherence to any variation of the pattern can lead to apps with a lot more overhead than can be justified. ... consider putting event handlers in your code-behind ....
[MVVM and language performance tips - UWP applications | Microsoft Learn](https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/mvvm-performance-tips)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
So, their "best practice" isn't exactly best practice for performance reasons? Color me "shocked."
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
-
So, their "best practice" isn't exactly best practice for performance reasons? Color me "shocked."
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
Using a pattern, on purpose, that obscures the power and potential of the platform is beyond not making sense.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
I'm shocked--shocked, I tell you--that MSFT would give a tinker's cuss for performance. For as long as I can remember, it doesn't matter what the hardware folks do to speed up CPUs or increase memory and disk space, because most of the software folks frivolously piss it away. I get the sense, admittedly somewhat superficially, that web-based applications in particular are absolute pigs in excrement when it comes to performance. Does performance still even matter?! If it does, and I wasn't retired, I'd be sorely tempted to find and work with folks who were aiming to blow all of this crapola out of the water.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.Greg Utas wrote:
Does performance still even matter?...If it does, and I wasn't retired
It really mattered in the 50/60s whether you used a bubble sort or a binary sort. For the single application that one would write then. Now companies do enterprise systems which can contain thousands or even tens of thousands of running instances which have far more serious issues with performance. None of which can be solved with tuning individual lines of code. Complexity of course drives that. There are many, many other factors that also impact it. As an example I once increased performance by about 60000% (10 hours to less than 1 minute) by changing requirements. Doubt increasing the CPU by 3% would have had that much impact. On the other hand I have seen developers spending more than a week 'optimizing' code which would have no impact at all on the user experience. Not to mention of course business practices that allowed customers to abuse the enterprise to such an extent (by not forcing them to pay for what they were using) that they then started complaining that the system was too slow. Customers like to complain about performance but often can't even cite what that actually means. And it is very seldom that they are willing to switch product/services because of that. It is the other features that they need/want which drive their decision. Not to mention the cost.
-
But MS says it better.
Quote:
... The issue with the MVVM pattern is that it can inadvertently lead to apps that have too many layers and too many allocations. ... But strict adherence to any variation of the pattern can lead to apps with a lot more overhead than can be justified. ... consider putting event handlers in your code-behind ....
[MVVM and language performance tips - UWP applications | Microsoft Learn](https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/mvvm-performance-tips)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Greg Utas wrote:
Does performance still even matter?...If it does, and I wasn't retired
It really mattered in the 50/60s whether you used a bubble sort or a binary sort. For the single application that one would write then. Now companies do enterprise systems which can contain thousands or even tens of thousands of running instances which have far more serious issues with performance. None of which can be solved with tuning individual lines of code. Complexity of course drives that. There are many, many other factors that also impact it. As an example I once increased performance by about 60000% (10 hours to less than 1 minute) by changing requirements. Doubt increasing the CPU by 3% would have had that much impact. On the other hand I have seen developers spending more than a week 'optimizing' code which would have no impact at all on the user experience. Not to mention of course business practices that allowed customers to abuse the enterprise to such an extent (by not forcing them to pay for what they were using) that they then started complaining that the system was too slow. Customers like to complain about performance but often can't even cite what that actually means. And it is very seldom that they are willing to switch product/services because of that. It is the other features that they need/want which drive their decision. Not to mention the cost.
I agree that optimizing the code is unlikely to help here. The problem is the high-level design, like how the many thousands of instances are supported. The mania for stateless servers that must continually recreate context is another problem. Poor performance in these types of soft real-time systems usually means one of two things: 1. The response time annoys users. 2. A lot more must be spent on computing equipment than in a system that is better designed.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
Gerry Schmitz wrote:
MVVM pattern is that it can inadvertently lead to apps that have too many layers and too many allocations.
Remind me again which pattern is it exactly that guarantees that can't happen?
You're talking wrappers, frameworks and methodologies (MVVM). A "pattern" can be a simple plug-in that "adds" functionality instead of masking or contorting it. MVVM is a "bunch" of patterns; all directed to "indirection". A simple statement like: NO code behind ... is a pattern (of behaviour).
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
You're talking wrappers, frameworks and methodologies (MVVM). A "pattern" can be a simple plug-in that "adds" functionality instead of masking or contorting it. MVVM is a "bunch" of patterns; all directed to "indirection". A simple statement like: NO code behind ... is a pattern (of behaviour).
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Quote:
Ok. But I don't see how that answers my question?
I gave you an example: a plug-in. Where are the "layers" and "allocations"? One function reference. Are you saying a plug-in is not a pattern? What is a "door"? Your "argument" is all patterns are "faulty". Back it up.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Quote:
Ok. But I don't see how that answers my question?
I gave you an example: a plug-in. Where are the "layers" and "allocations"? One function reference. Are you saying a plug-in is not a pattern? What is a "door"? Your "argument" is all patterns are "faulty". Back it up.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I