BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. Scrum
  2. Apache Maven 2
  3. Essential MySQL
  4. Node.js
  5. Groovy
  1. jQuery Selectors
  2. Ajax
  3. Java
  4. Spring Config.
  5. Java Concurrency

Link Details

Link 355149 thumbnail
User 452305 avatar

By fifthposition
via wordpress.transentia.com.au
Published: Feb 04 2010 / 12:30

In oh, so many ways! Groovy’s MarkupBuilder class can really clean up your code.
  • 11
  • 1
  • 1977
  • 3

Comments

Add your comment
User 200690 avatar

a1programmer replied ago:

-1 votes Vote down Vote up Reply

What a joke! lol.

User 209458 avatar

paulk_asert replied ago:

0 votes Vote down Vote up Reply

In what way?

User 200690 avatar

a1programmer replied ago:

0 votes Vote down Vote up Reply

You know, when I first saw this, the code used to generate that output is so ugly, I did not think the author was being serious... I thought that it was someone being sarcastic.

Generating HTML from code should be highly avoided if possible.




User 209458 avatar

paulk_asert replied ago:

0 votes Vote down Vote up Reply

It may seem a little ugly. What's not obvious at first glance is that the example is somewhat of a unit test. Showing every possible combination of syntax, e.g. every String type, every option possible even when not needed. As the author says, it was an “external brain dump” type of post - one that you can come back to and look up the one style you need for your task at hand. Re "avoiding generation of HTML" if possible, well I would say that it needs to be looked at on a case by case basis. We have some sites where duplication is reduced by several orders of magnitude by using generation: sometimes templates, sometimes code such as shown for this article. Unless I got paid by the hour to write HTML and had a gullible and wealthy customer, hand writing HTML wouldn't even be a starter for some of these systems.

Disclaimer: I didn't write the blog but do know the author.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (11)



Voters Against This Link (1)