Buy Used
+ £2.80 UK delivery
Used: Good | Details
Condition: Used: Good
Comment: Former Library book. Shows some signs of wear, and may have some markings on the inside. 100% Money Back Guarantee. Shipped to over one million happy customers. Your purchase benefits world literacy!
Trade in your item
Get a £0.59
Gift Card.
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Code Generation in Action Paperback – 7 Aug 2003

1 customer review

See all formats and editions Hide other formats and editions
Amazon Price New from Used from
"Please retry"
£51.46 £2.72

Trade In this Item for up to £0.59
Trade in Code Generation in Action for an Amazon Gift Card of up to £0.59, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Learn more

Product details

  • Paperback: 450 pages
  • Publisher: Manning Publications; 1 edition (7 Aug. 2003)
  • Language: English
  • ISBN-10: 1930110979
  • ISBN-13: 978-1930110977
  • Product Dimensions: 18.8 x 2 x 23.4 cm
  • Average Customer Review: 1.0 out of 5 stars  See all reviews (1 customer review)
  • Amazon Bestsellers Rank: 203,665 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, and more.

Product Description

About the Author

Jack Herrington is a software engineer with 20 years of experience developing applications using a diverse set of languages and tools. He has shipped applications from scientific real-time applications to web applications for business. He is an expert in the use of code generation techniques from very simple code maintenance to code generators, which build entire tiers of functionality. He lives in Union City, California.

Customer Reviews

1.0 out of 5 stars
5 star
4 star
3 star
2 star
1 star
See the customer review
Share your thoughts with other customers

Most Helpful Customer Reviews

Format: Paperback
The book covers some very simple code generation techniques without much practical application, e.g. the code generation for business logic has a generator to turn (a=b+c) into 3 lines of code that uses objects instead. Other generators include documentation generators and some wrappers, all written in Ruby. The actual content of the book should be how to leverage and apply code generators in a realistic application looking at the types of problems you would encounter, etc, instead the book is divided into several very rudimentary chapters that cover generators like documentation generators, test case generators (there are much better books on this), there's nothing at all on using a domain specific language as one of the chapters claims this topic is outside the scope of the book.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Helpful Customer Reviews on (beta) 21 reviews
10 of 10 people found the following review helpful
Good book with the right perspective and plenty of examples 30 Oct. 2003
By Zen Micro User - Published on
Format: Paperback
The writing is precise and clear with annotated examples everywhere. Positioning and justification of various techniques is very compelling.
The author's classification of various forms of active code generation clearly elucidates the potential of Code Generation. Usage of templates for code generation is an excellent suggestion. Explanations on various code snippets and regex macros are simply second to none. Chapters 3, 4, 5 and 10 are a must read for every developer.
Having implemented a large-scale database conversion from IDMS to DB2 (schema, data dictionary, run time and programs) using home grown automated generators in the past, I really enjoyed reading Chapter 10. I completely agree with the assertions made there and I am impressed by the way the author addresses common concerns. This chapter documents a practical approach to ease the burden of writing repetitive code for code heavy frameworks. Schema Oriented Code Generation is a practical approach to code generation. I also find various references in this Chapter and others extremely valuable.
The author has shown that with sufficient metadata about a system, a significant portion of the repetitive coding tasks relating to data access, user interface, test and documentation can be automated in a consistent manner using custom code generators.
It is refreshing to see code snippets in Ruby. The author's selection of Ruby becomes self evident after reading the various code snippets.
I find this to be a very compelling book and a must have for architects and seasoned developers!
10 of 12 people found the following review helpful
Finally a dedicated book on the subject 29 Nov. 2003
By Foti Massimo - Published on
Format: Paperback Verified Purchase
I embraced code generators long time ago, so I was more than happy to finally found a dedicated book on the subject, since this is almost unexplored topic. The author clearly has a solid understanding of the topic, and manages to deliver a compelling book, with an excellent flow, where each chapter builds on previous concepts and ideas.
All the code snippets and regular expression samples are explained in a very clean, detailed way. I was pleased to see that many examples were non-trivial, covering concrete, real world, implementations. Herrington uses Ruby as an implementation language; you may like it or not, but what really matters here are the concepts, not the syntax and even if you don't know Ruby (like me), you will find the code pretty easy to follow.
41 of 57 people found the following review helpful
Poor choice of tools; code not very useful 17 Dec. 2004
By John Broglio - Published on
Format: Paperback Verified Purchase
I have been doing language parsing and generation in C for several years: English, French, Japanese, Chinese, Korean. Still, I hoped to learn something new from CGIA for Java. I was disappointed. I think the book misdirects the reader away from more effective solutions into less productive paths.

The book suffers from two problems. (1) the regular expression technology proposed is inappropriate (2) the exercises provided are not rich enough to be useful.

I have no objection to scripting languages. I have happily used bash, gawk, python/Jpython and php. I avoided perl because I was struck by its lack of readability and writability. Ruby is no better and no worse than many scripting languages, but the documentation and error messages leave very much to be desired. CGIA offers almost nothing in the way of real help with the language. It took me some time to figure out how to install the libraries properly and debugging was a nightmare! Ruby's regular expression language is yet another variation in the regex language Babel. This is not something I would foist on developers in my organization. Especially when there are much better alternatives.

For years I have been using lex (flex actually) in C for code generation and human language processing. (I have never had much use for YACC/Bison.) When I switched to Java, I found an excellent flex equivalent called JFlex ([...]

JFlex.jar is around 240K. The regular expression language for JFlex is extremely close to that of lex and gawk. It is much more readable and modular than that of ruby, perl, etc. Your Java programmers and maintainers need not learn a new language or download/install/configure an additional 28 MB of libraries. Even better, they can use JFlex in runtime production code, since it produces compiled FSA's which are orders of magnitude faster than an interpreted regex processor like ruby.

Additionally, you can get with lex/flex/JFlex full grammars for C++ and Java, not the superficial variable reader that came with CGIA. And the debugging mode, while not perfect, is quite usable. (There are commercial visual tools for debugging flex grammars, if you need and can afford them.)

From the code point of view, I found nothing usable in CGIA. In my judgment most of the examples were more suited to the classroom than to work, and the solutions presented were often not competitive with alternatives. On the theory/fundamentals side the book does not contribute much to the the understanding of language parsing or generation issues.

The arguments for using code generation are cogent. But if you want to use a more useful, popular, constantly evolving (but equally poorly documented) code generation system, go for XDoclet.

My recommendation: skip CGIA. Spend your time and money learning flex/JFlex for parsing and XDoclet for generating and you will be much better off. If you want theory, sink your teeth into something like the "Dragon" classic (Aho & Ullman).
8 of 10 people found the following review helpful
Great introductory material on code generation 22 Dec. 2003
By Lars Bergstrom - Published on
Format: Paperback
The introduction and motivation are quite compelling, though a bit more detail on the dismissal of passive code generators (i.e. wizards) and focus on active code generators would be nice. The examples are also quite practical and seem high quality, though the use of Ruby is going to be a barrier to some.
There was one guest-written chapter that might as well have been elided, or should at least have been more edited to integrate cleanly. It repeated a lot of what had been said earlier, and could've just jumped straight to the point instead.
Finally, the code samples were a little repetitive in places. I would've preferred the book were shorter, with more info at the level between high-level and code (i.e. what does it make sense to paramaterize, and how should your generator work) rather than focusing either at the high level of 'architecture' or the low-level of 'how a single variable replacement works'. Still, an excellent book, and quite a good introduction for those who don't use code generators already.
8 of 10 people found the following review helpful
A good introduction to meta-programming. 27 July 2004
By Mike - Published on
Format: Paperback
I had already written a few code generators when I saw this book and was hoping to find some insights into improving and extending what I had already done. The introduction gives a really nice overview of the designs patterns you can use. But this book is not about programming and the author assume you have the skills to implement the program you want to meta-program already.

The author illustrates his approach using a language I had never heard of before, Ruby, which is an OO scripting language that is quite compact and powerful and included is some basic tutorial info in the appendices to help you follow the examples. Overall a good book that I am glad I own and have read. I get the feeling I am going to go back to it many times.
Were these reviews helpful? Let us know