Model Based Development vs. Performant Code

Gen has been at the forefront of Model Based Development for 20+ years – BUT people who develop in Gen rarely if ever get to look at the code that the toolset gives them – why would they ?

Well – one could argue that if a programmer could not see his or her code, then they would not be truly programming – moreover – if the code that Gen produces from it’s generators cannot be tweaked for performance reasons, how can the programmer be sure that the code is performing correctly – and at its optimum speed ?

Health Warning !!!  – it’s folly to tweak the code – for as we all know – the next regeneration will undo that tweaking. No – in my opinion, the best way to get performant code is not to worry about the code at all (bizzarely !!).

The best way to get performant code from Gen is to get the data model right in the first place !

Then ensure that the database is indexed correctly and those indexes correctly support the business’ retrieval needs.

Of course there are the old adages that  ALL programmers know – stuff repeatedly like calculating values inside loops is a waste of CPU cycles. No – what we are talking about here is harnessing the power of Gen by simply not worrying about it – as long as the data model is right and the code has been sensibly clicked (such as only reading values once, view starving and so on) then the code will “be ok”.

O f course there will be the occasions that the code needs attention, once performance testing has been carried out, but they should be addressed at the data model level, or re-ordering code, rather than physically tweaking any SQL that has been produced.

The point here is that even though the average Gen developer doesn’t know what code his AB’s produce – he shouldnt need to – as long as some guidelines and common sense have been followed.

Such is the power of Model Based Development !

Share