Why programming is much harder than modeling?
Yesterday Rafael Chaves wrote on Google+:
1:48 AM (edited) – Public
“There is something confusing about the idea of good modeling being hard. After all, all one is doing is describing how the system is supposed to work without having to worry about the implementation details. If one can’t do that, then how is one supposed to manually create a correct, working system?”
Well put, +Thomas Mercer-Hursh!
Just wrote a post about that on my blog:
It’s interesting to see that some people believe that modeling is harder than pure and classical programming. Not only I agree with Rafael that this is not true, but I have the opposite opinion. IMHO, Programming is much harder than Modeling. When you build a program, you are performing (at least) five tasks:
- Modeling the surrounding world (or the domain)
- Modeling thee underlying executable platform.
- Modeling the applicative user needs (application or user requirements)
- Merging these three models (synthesis) into one that will be executable.
- Deploying the solution in a real environment.
On the contrary, when you are modeling, you concentrate only on one aspect. The problem of merging models comes only later.
So this is why programming is a noble and difficult art, much more complex than modeling. Programming (a contraction of “program engineering”) is a very complex synthesis of the three models pictured below, and probably much more:
This idea is not new. I remember a guest talk given by Michael Jackson, a long time ago, at the second OOPSLA conference mentioning it. I was very lucky to listen again to these ideas at the Cambridge celebration of the work of Tony Hoare in 1999 where Michael gave a talk on “The Real World“:
In this talk, Michael Jackson refers again to the inspirational work of Brian Cantwell-Smith by borrowing the now classical representation of the central nature of programming:
Looking at this illustration, we understand that the central issue of programming is to build a complex composite model that will bridge the world and the machine, under some difficult constraints.
All this also explains why we should pursue all efforts on software modeling. The most difficult task is merging all models to produce one program. We know two things:
- in specific cases this is possible and has been achieved by simple code generation techniques
- in the most general cases, this is likely to be beyond reach for a long time
But we know also that having clean, clear and rigorous models of the domain world, of the platform, of the application requirements, of the QoS constraints, etc. will make easier the life of the programmer, specially if these models may by automatically processed.
In this view, the OMG tentative to propose in 2000 the MDA(tm) initiative with fuzzy correspondences between CIMs, PIMs, and PSMs may be considered now as a very naïve simplification, not very helpful. But it had the advantage of emphasizing the hard problem of explicitly dealing with the world (domain or CIM/PIM) and the machine (or platform, PSM).