Pages

Monday, December 13, 2010

Are code generators good for you?

"Our product helps developers focus on solving business problems, not technical ones"

I bet you can find a similar sentence on the website of any code generator out there in the market.

Here are just two of the ones we've tested:

GeneXus:




XAF:









Every developer knows that there is pa
rt of every user-interactive system that is repetitive, and sometimes end up taking more time than the business logic itself. I'm talking about forms, tables, and everything made to keep data integrity between those two. In systems where there is a lot of data to deal with this becomes really annoying. You have to build the database tables manually, build forms manually, create validations, select, insert and update scripts, all the routines for the maintenance, and run extensive tests, because as we all know, there's a higher possibility of making mistakes when what you're doing is repetitive.

That's what these generators want to solve. If all that boring part is automated, all you have to deal with is business, right?

Partially. As you may have already calculated, these tools can't read your mind, and telling them what you want can sometimes get tricky. In an attempt to make the development process easier and easier, these tools often end up with something so different from regular manual development that learning how to use it properly may take longer than you expect. That's the case with GeneXus, which has its own philosophy, and even its own language.

There are a few items you might want to consider if you want to use code generators like those:

Learning Curve:

As Felipe has mentioned in a previous post, I've had a week-long GeneXus course last week. And we've taken the shortest one of three options (the longest takes one month!). How's that for something that was created to make the development process easier? I'm not criticizing the complexity of the tool, I'm warning those who think about changing their development methods and are considering using one of these tools for its speed and simplicity.

Code Quality:

This should be quite predictable, but some managers might misunderstand where generators are useful. Code generators don't generate beautiful maintainable code and don't generate 100% efficient code. The only advantage of it, is that you didn't need to put too much effort into it.

Reusability:

Another point where managers usually don't get the point. Since generated code isn't usually as good as a developer would write, it shouldn't be reused at all. If you can't find your ways to do something thought the generator, don't even consider editing the code because sometimes that would mean to abandon the generator, since what you change won't be translated back to the generator (unless in very specific cases).

Some programmers might not like it:

My instructor has mentioned that everywhere he does a demonstration, managers love it, and developers hate it. That was the case with me initially (and mildly to this day). Why wouldn't a developer like something that will take the boring part out of his work ? Because the price for that is to change the way they do the rest, and if developers are always growing better in their career, having to work with something too specific might sometimes mean to change their path and learn something that's not interesting for other employers.

Lastly, if you're aware of these points, and you're ok with some restrictions, this might be a good step to take. Be sure to choose a tool that is widely adopted, has a large community, and well documented.

No comments:

Post a Comment