Grey Line

That came about during the best practices show. One of the panel speakers, while making a disclaimer that he is not hands-on, said that he does not believe in code generators. At that point I just thought it was funny as it goes along the line “Why people who do not wash dishes think that dish washing machines are not needed?”. But after the show I met a few people and some thought that application generators should be avoided. I was not able to find out “why” though – it was more of the way they felt rather than a argument. So why do they feel that way?

I do not know. Let us do a mall exercise first. Open a new Flex project and create a new FDS application project. Before you even write a single line of code Flex creates 30 files and 120+KB of code in background. You can see them by adding –keep switch to the compilers command line. Before you are finished with login screen you have 100 files in the generated folder. Is it good or bad?

It is expected. It is good in a sense that you do not have to write this code yourself. It is good that it will be compiled rather the interpreted giving you the best performance possible.

Code generators are essential part of every IDE product and there is not need to debate this. Every productivity language/compiler (starting from Assemblers to C to C++ and the modern ones) has some code generators built into it. Most of software development tools I know are using code generators of some kind. Another example – if you are the programmer who are just filling the blanks in someone’s framework as oppesoed to being a creative writer – you are also a code generator to some degree.

There are good and bad code generators, but they are not solving their problems, but rather helping you in solving your application’s problems. They are just the power tools that implement best practices for solving domain problems.

People take domain-specific problems (either in the form of code annotations or just a as a standalone resource like UML in which you embed a host language) and generate the code that you can see and modify. You are doing it every day. For example, Flex processes annotations embedded in the ActionScript and MXML. So when you use [Bindable], [Managed] , [Event] or just include CSS references you are telling Flex code generators that you want certain patterns applied to this code fragment, and Flex generates a bunch of files in the background. You really have to be hands-off to use and denounce code generators in the same time.

Code generators are getting better and better. Bugs are eliminated, the language flexibility increases, new domain problems are added and automated. The best optimizing compiler produce better code (efficient, compact or anything in between) then any human. With alphas and betas of Flex, I’ve been studying the code in the folder generated . After a wile, the entire process became completely transparent to me.

Our code generators belong to the 3rd generation. They work in background, generate and insert the into “invisible” locations. You do not need to see this code or build the resulting code separately. They perform hot deployment and provide automated and visual test code. You apply your code changes directly in the mix of the application code and domain annotations. You never have to see generated files – or at least not more often then you have to see files generated by Flex. For certain types of applications one person can be as productive as 3-4 developers. He does it faster and with less effort. The concepts of code visibility and rules of generated code invocation are identical with Flex even though the products are coming from different environments, but after all these are common best practices of the modern software development.

I think the problem is that most of the people think of generated code as source. Let me give you another example. We take a Java file with some SQL or other annotations and run it through our code generator. It produces the DAO and Assembler classes, multiple DTOs, deployment descriptors, deploys the jars and places all low level artifacts that you do not need to touch (ever) in your Flex project. That is where most code generators stop. We made sure that our generators are fully open; you can add templates for generating other type of code and modify the existing ones.

Over time, your reference implementations will have templates for databound datagrids, forms, master/details forms, reports, TreeGrids and other TEST samples for people to try the power of really fast development. The main target with the products are metalanguage files disguised as MXML extensions. However, people can take test the code and happily embed it in application. The changes come and they have to propagate these changes manually – and they say the process does not work.

That process indeed does not work – but it’s not the code generator’s fault. It just means that while the tool was working with annotations in Java and users somehow expected it work transparently on Flex side (and we did not have any annotations there yet). In order to achieve the  synchronization between Flex and Java,  you need another code generator that would allow you to process Flex annotations in the Flex compiler. We requested that feature in compiler over a year ago, and I was told it is in the plans for Flex 4 ;) . However, as soon as Flex compiler goes open source, it should be fairly simple to embed your own code generators that would enable synchronization. For now, when we need to augment Flex with business domain functionality like business expressions a la Excel or Powerbuilder, we run source-to-source generators that are transparent to the developer.

Sincerely,

Anatole Tartakovsky

PS. I wrote these notes on the flight home. These morning I thought about other things, and I believe I got an idea why some people  do not believe in code generators:

1. They were much younger than me. Coming from the times when bytecode referred to bytecode of CPU, quest for Productivity Holy Grail is automatic for me. And experience with preprocessors, RADs, 4GLs and metalanguages allows me to see different implementations of generators as probably the most powerful way to incorporate best practices . Here is how I see it: It is ok to teach people how to recognize patterns and communicate among themselves using these patterns. A code generator is a way to communicate these patterns to the computer in the best possible implementation using the input provided by people using the patterns.

2. Somebody needs to explain people the difference between code generators and source code generators. A lot of people went to preceding Flex 3 sessions where they saw dialogs based code generation for PHP. They automatically associate (that’s what people do best after all) the CRUDe source generator with the similar functionality provided by domain extensions of our code generators. Well, if I’ll ever be invited to participate in a keynote, I’ll try to explain it to more people so there won’t be any confusion ;)

Comments are closed.

canada online pharmacy propecia
free cialis
buy cialis without rx
cheap cialis
viagra quick delivery
levitra overnight shipping
best price cialis without perscription
hydrochlorothiazide cialis
50mg viagra
cialis discount prices
best price cialis
canada levitra
online viagra levitra cialis
cialis pills for sale
indian cialis
cialis free samples
when will viagra be generic?
buy cheap viagra online uk
order generic viagra canada
where can i get cialis
generic viagra online pharmacy
cheap online propecia
propecia from canada
best price for generic viagra
where buy viagra
cialis 5 mg
viagra off internet
alaska viagra doctors
buy viagra online without a prescription
viagra onlines
propecia sales canadian
cialis ottawa pharmacy
cheapest viagra online
online ordering propecia
buy cheap uk viagra
overnight viagra
viagra online buy
buy propecia 5mg
online order viagra overnight delivery
how to buy viagra in canada
propecia discount
cialis daily canada
canada propecia prescription
vardenafil:
cialis next day delivery
order viagra in canada
cialis free delivery
uk cialis sales
buying generic propecia
canada viagra
levitra without prescription
generic viagra australia
cheap cialis from india
buy generic cialis online
online presription for viagra
best viagra and popular in uk

real viagra without prescription
levitra online without prescription
liquid cialis for sale
buy generic cialis online from canada
viagra express delivery
soft gel viagra
buy cialis pill
canadian generic cialis
tablet viagra
100 mg cialis
buy cheapest cialis
propecia for sale online
overnight propecia
viagra price
get cialis online
buy cheap generic cialis
viagra replacement
viagra online in canada
order cialis from canada
prescription needed for cialis
menu:
50mg viagra
viagra for sale online in the uk
cialis canada on line
viagra mail order usa
cialis viagra
viagra 100 mg
cialis for less 20 mg
levitra viagra online
find cheap viagra online
online viagra au
online generic cialis 100 mg
online pharmacy propecia
pfizer viagra no prescription
buy propecia online cheap pharmacy
to buy viagra online
propecia
viagra doses
i want free viagra
buy real viagra online no prescription
viagra for woman
brand viagra professional
sildenafil viagra
cialis now
viagra for less
lowest price for viagra from canada
where to buy cialis cheap
viagra online in canada
canadian healthcare cialis
cialis kanada
cheapest levitra uk
cheapest viagra in uk
no prescription viagra canada
canadian pharmacy cialis no rx
cheapest prices on propecia
viagra samples
cheap discount cialis
viagra tablet weight
low price viagra
viagra canadian pharmacy support
cialis us drug stores
generic cialis next day delivery
viagra canada cheapest
buy propecia online
generic propecia canada
find cialis no prescription required
propecia cialis viagra
cialis strenght mg
lowest-price propecia costs us
discount cialis levitra viagra
buy viagra for women
real cialis online
drugstore best buy generic cialisbuy generic cialis
generic viagra canadian pharmacy
cialis testimonial
propecia generic
viagra how much
buy propecia no prescription
find viagra without prescription
buy generic cialis online
no rx viagra
cialis free delivery
viagra from uk
cheap canadian viagra
buy generic cialis
cheap cialis pills
levitra 10 mg without prescriptions
viagra pfizer canada
cheap viagra for sale
cheap cialis online canada
viagra echeck
cheap cialis online no prescription
propecia orders
cialis without prescription in canada
low cost canadian viagra
viagra/cialis sales
buy cialis without prescription
generic propecia for sale
cheap viagra canada
can i buy viagra in canada
nizagara viagra online
viagra mail order
www.cialis.com
viagra sales online
viagra in china
canadian pharmacy viagra cheap
ordering viagra online
cialis canadian cost
buy viagra online without prescription
viagra with no prescription in britain
find viagra no prescription required
cialis daily canada
cheap brand name cialis
vardenafil generic
buy propecia without a prescription
the best price of viagra
try cialis for free
order cialis in canada
usa cialis women
generic cialis sales
viagra sale
sale of viagra tablets
womens viagra no prescription
di scount 50 mg viagra
buy cialis online australia
cialis online australia
real viagra without a prescription
buy cheapest viagra online
cialis canadian online pharmacy
sale viagra
alternative for viagra
prescription for propecia
buying cheap cialis
viagra order
viagra com
purchase cialis next day delivery
online viagra levitra cialis
professional cialis online
combine cialis and levitra
prices for propecia
real viagra to buy
sildenafil
levitra for sale
cheap order prescription propecia