Code Generators

P

Pavel

I have never been one for code generators, but I find myself facing more
and more complicated projects where there IS an "I" in team.

Time given on projects is smaller and smaller, and more and more is
expected of me.

I currently only use the JBoss IDE and Hibernate Synchronizer plugins
for Eclipse, which are great when you pair the two together, but I feel
like there is still a lot missing.

So, I am faced with the question... am I missing some secret magic
bullet for code generation with pure and proven results?

Does anyone have a specific Superman type of development methodology
when building applications on a team of one with a bologna and cheese
budget?

I've tried Google plenty of times on the issue, and I have been looking
at the following solutions, some of which I have tried:

Velocity templates
Middlegen
AndroMDA
Code Futures - Firestorm DAO

I am also a big fan of ArgoUML and StarUML seeing as they are free, and
create my application skeletons, but again, I have to piece together
parts of tools in order to get what I want.

Please let me know if you have been using any of the mentioned tools
successfully. Do I REALLY have to spend $4000+ for an architect
platform? Anyone have any other ideas?

Thank you,
Pavel
 
A

Alvin Ryder

Pavel said:
I have never been one for code generators, but I find myself facing more
and more complicated projects where there IS an "I" in team.

Time given on projects is smaller and smaller, and more and more is
expected of me.

Hmm, I know what you mean ;-)
I currently only use the JBoss IDE and Hibernate Synchronizer plugins
for Eclipse, which are great when you pair the two together, but I feel
like there is still a lot missing.
At least there are some great IDE's these days, I really like Eclipse.
So, I am faced with the question... am I missing some secret magic
bullet for code generation with pure and proven results?
Good question but I don't think you're missing out on any magic.

In the first 15 years of my career I spent way too much time and energy
trying to answer this very question. What did I find?

Moore, co-founder of Intel "says the number of transisiters will double
approximately every 2 years" aka Moore's Law. But is there a software
analog for this?
Does anyone have a specific Superman type of development methodology
when building applications on a team of one with a bologna and cheese
budget?

In the 70's Fred Brooks issued a challange to "find the silver bullet",
which was something like a 10 fold increase in productivity over a 10
year period.

Has it been found? No, at least not to public knowledge. If it was
found then why don't we all know about it? Sure some *hype* claims such
productivity but is it reality? I doubt any proprietry has found the
secret either.
I've tried Google plenty of times on the issue, and I have been looking
at the following solutions, some of which I have tried:

Velocity templates
Middlegen
AndroMDA
Code Futures - Firestorm DAO

My productivity actually increased when I faced reality and just got on
with my job in a neater, tidier, simpler way!

I'm no saying we'll never find the silver bullet but when I was chasing
it severely my code had all sorts of /extra/ guff in it which did
nothing but increase complexity and therefore reduce productivity!
I am also a big fan of ArgoUML and StarUML seeing as they are free, and
create my application skeletons, but again, I have to piece together
parts of tools in order to get what I want.
Hmm, I think not. Free to buy but what about the time?
Please let me know if you have been using any of the mentioned tools
successfully. Do I REALLY have to spend $4000+ for an architect
platform? Anyone have any other ideas?

Even if you spent $4M you wouldn't find paradise. Sure code generators
spit out some code but what happens when they can't quite express what
you need?

You need to change the code by hand and the generator and your code
become out of sync, bye bye productivity, hello nightmare.

They are actually just course-grained specialized languages with
limited expressive power. If you stay within their expressive limits
you're ok but then bang.


The things that have actually helped me go faster are:-
1. stop chasing the wind and any super productivity increases,
2. *always write easy, simple, direct, "bare bones" OOP code,
3. *always keep everything neat and tidy,
4. make code useable - forget "re-usable".

My other great vain pursuit was "re-usable" code. Well to be reusable
it must first be usable! So when I just forgot about "re-usable" code
and made it usable", I went much faster, wrote alot more and lo and
behold a lot of it turned out to be reusable after all (but not
deliberately).
Thank you,
Pavel

Of course some languages and tools are better at certain tasks, but I
think the biggest factor by far is us.

Eliminate waste, complexity and vain pursuits - that is "my secret".

Hope that helps.
Cheers.
 
L

Larry Barowski

I'll agree with everything Alvin said except this:
4. make code useable - forget "re-usable".

In many cases you can be almost certain that you will reuse
the code, and it is worth the extra time to make it reusable
and flexible.

To the OP: with the exception of things like parser generators
and for anything other than the simplest of projects, code
generators are a long-term productivity killer. I would
even stay away from frameworks unless you can modify
the source code or unless you are ABSOLUTELY sure you
and the customers will never want any functionality that the
framework makes impossible or extremely difficult to
implement. Ah the hours, days, and weeks I've spent
battling the MFC MDI framework to make some tiny
changes that the customer demanded. I would have saved a
lot of time by just creating my own framework in the first
place.
 
E

EricF

I'll agree with everything Alvin said except this:


In many cases you can be almost certain that you will reuse
the code, and it is worth the extra time to make it reusable
and flexible.

To the OP: with the exception of things like parser generators
and for anything other than the simplest of projects, code
generators are a long-term productivity killer. I would
even stay away from frameworks unless you can modify
the source code or unless you are ABSOLUTELY sure you
and the customers will never want any functionality that the
framework makes impossible or extremely difficult to
implement. Ah the hours, days, and weeks I've spent
battling the MFC MDI framework to make some tiny
changes that the customer demanded. I would have saved a
lot of time by just creating my own framework in the first
place.

Well the MFC MDI is a CF. Agreed.

Code generators can be handy though. I recently had a Java project where there
was a lot of CRUD to a database through a 3rd party API. There really were no
requirements and the user's didn't know what they wanted Thios should not have
been a project. But my orders were clear - do this.

I wrote an abstract class to handle the common muck, and a code generator to
handle the class specific muck. The code generator handled about 90% of the
code needed and I filled in the gaps. This turned a 2 month project into a 2
week project.

Big overblown frameworks can be a mess. Small tools such as code generators
can be beneficial. Some frameworks are nice - I like Ruby on Rails.

Eric
 
D

David Segall

Pavel said:
Does anyone have a specific Superman type of development methodology
when building applications on a team of one with a bologna and cheese
budget?
Both Sun and Oracle seem to be advocating Java Server Faces as the
preferred methodology for developing web based applications. Sun offer
a free RAD tool in the form of Java Studio Creator
<http://developers.sun.com/prodtech/javatools/jscreator> which is
aimed at inexperienced programmers working on "enterprise"
applications. Oracle's JDeveloper, which is a free comprehensive Java
IDE, includes RAD tools for JSF development.

I am not qualified to compare these tools and techniques with the ones
you list but I would be interested to hear from those who are. If you
feel like spending a day or two with Java Studio Creator I'm sure you
could build a simple database application and I would appreciate your
comments too.
 
K

Kent Paul Dolan

Pavel said:
Time given on projects is smaller and smaller, and more and more is
expected of me.

This is one of the prime reasons that software developers
tend to move on to a new employer every 18 months or so.
It is easier to deal with a new employer that seems sane
than an old employer who has proved not to be.
Does anyone have a specific Superman type of development methodology
when building applications on a team of one with a bologna and cheese
budget?

Probably not, but several technologies
each seem to provide a modest but reliable
productivity improvement' for examples:

The Eiffel "programming by contract" technology.
The JUnit "write testing first" technology.
Use of Design Patterns technology to reduce
architecture and design effort.
Finding open source code that does what you
want, via search engine technology.

Better than all these are, is just forming good
habits: "keep it simple, stupid" is the most
important one in my estimation. Nothing bogs
you down faster than making the chunks in
which you deal when programming too big for
you to comprehend.

I'm not a fan of IDEs myself; at my skill level,
they just seem to get in the way.

There are also much higher level technologies,
but those are mostly at a shop level rather
than at an individual level. One example is
restructuring your shop to be a formal "Software
Factory", which is not yet a mature technology,
but one that shows promise:


http://www.amazon.com/gp/product/0471202843/002-0988965-0684852?v=glance&n=283155

HTH

xanthian.
 
D

Drazen Gemic

EricF said:
Try using some reflection. It can provide some shortcuts.

There is something that worked for me, when dealing with
relational databases. Instead of creating a class for
every database structure ('Person', 'Company'....etc.)
I retrive and update data through HashMaps.

DG
 
D

dimitar

Larry said:
I'll agree with everything Alvin said except this:


In many cases you can be almost certain that you will reuse
the code, and it is worth the extra time to make it reusable
and flexible.

In my experience even if you put the extra effort and make it *flexible*
it still might not be *reusable* if the flexibility is not at the right
points. I agree with Alvin that if you make it clean and simple, you
have better chance to add the features you need later (I think XP
advocates call this YAGNI).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top