Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
by Unlicensed Unknown user

Read Part 11

I've written a few templates over the years. Not as many as template mavens like Mike Hanson and Lee White, but I've touched just about every aspect of the template language at one time or another. And more often than not I find myself peering into a dark place somewhere in the bowels of the template engine, wondering what gyrations I need to go through to get the AppGen to spit out the code I want. That's not because the template system is bad, it's just very powerful and very complex. 

...

It's been a long road from that first question Greg Fasolt raised about the original class and template. I had the most fun with the classes and the unit tests, and lost the most hair with the template.

 

 This series isn't a perfect analogue for my idealized Clarion development cycle, but it hits a lot of the high points:

  • Test-driven development (TDD): If there's only one thing you take away from these articles, it's the idea that you start with a test. Creating tests first has so many benefits and will drive much of your development in the right direction.
  • Classes: You don't need to develop with classes, but there's a good reason software development is so heavily invested in object-oriented development.
  • Extract business logic into reusable code: Again, much easier with classes.
  • Working code before templates: In fact I don't write that many templates because for simple situations they're not necessary and for complex situation I need a lot of reuse to justify the investment. But when a template is called for it's essential to have working hand code in place for comparison purposes. 
  • Refactor, refactor, refactor: This is an endless process, because almost all code can and usually should be improved in some way. 

And speaking of code improvements, there are still some loose ends to tie up. More to come!

You can get the latest version of the classes and templates at the ClarionMag GitHub repository.