The MVVM design pattern has been around for quite a while now. It has a lot of strengths when done correctly. But, I believe the time has come to recognize that MVVM has a lot of shortcomings that point to its demise. Since I primarily develop web applications, I will keep this discussion centered on the use of MVVM in web applications. The use of MVVM for desktop may or may not have these same issues.
I realize that for some of you, the very suggestion of dropping MVVM will invoke a negative emotional response. Some very smart people have quit their job at the suggestion that MVVM and its close cousin two-way data-binding, be abandoned in favor of another way. But just for a few minutes, I would like for you to stop treating programming as a religion and consider the possibility that there may be a better way.
Coding Katas are a way of developing your skills as a programmer. I thought it might be informative to tackle one of the classics as a blog post. Depending on how this works, I may or may not do another one quite so publicly.
The rules I’m going to try to adhere by.
I will document what I am doing as I go.
This is not a pre-coded blog post. You’ll get to “see” me code as I go.
I will write all tests first.
I will only write enough code to make the current tests succeed.
In my recent coding, I’ve discovered an even more simple way of dealing with this problem. In the process, it removes the anonymous function and eliminates the linting error, ‘Don’t make functions within a loop’