ClarionLive show notes for June 21 2013

CIDC update

CIDC registrations are coming in! Early bird special is over at the end of June. There will be DMC training the first two days, at the same time as the NetTalk training. 

Code smells

Mike talked about code smells, and mentioned Martin Fowler's Refactoring book. Today's code smell: duplicated code. If you see the same code more than once, refactor. Options include local routines and procedures, procedures, classes, even using include files (although having raw code in an included file is generally not a great option). There are a number of other pitfalls to using include files with raw code (e.g. not a procedure or a class, just some code). 

Word of the day: Order

Greg Bailey discussed using Order to sort view records. You can do an evaluation as part of the Order. There was some discussion of the gray area around matching up keys to Order statements. Bruce mentioned the importance of using Upper with strings in case insensitive keys and Order. Depending on the SQL server you're using, not using Upper on the strings in this situation may result in a table scan and much slower data retrieval. 

Mike mentioned that if you don't specify an Order then the view will use whatever order is specified on a Set before accessing the view's records. 

You can use PROP:ServerCaseInsensitive to tell the file driver not to Upper all strings for comparison. But in that case you had better be sure that your database is in fact case insensitive. 

The Invoice DCT refactoring

We continued with the Invoice.app, which has many compile errors due to the dictionary changes. Mike exported the TXA. He also created a Git repository and dropped it into GitHub for Windows. Someone mentioned SmartGit as an easy Git UI tool. 

The relation tree template used to display the invoices (not that this is a good idea) didn't make the trip through the TXA in very good condition. Mike had to resupply most of the settings by copying them individually from the old app. And there were a bunch of other things that had to be fixed up on the tree. Tedious.

But in the end, Invoice.app worked the same as before but with a much better database design. 

Get the recording at ClarionLive.