Wednesday, November 3, 2010

Ax Trivia - The human factor

Anno 2010, computer code is still written by humans. And though by default you want to take the human factor out of it (think of the sporadic human error), there always stays a bit human-like element in the code, even with all the best practices checking going on.

Thank God those coders have a sense of humor as well, as you can see in this post at GotDAX.

But there are also typos or simple spelling errors in the code. Examples? (From Ax 2009 SP1).

In the Shop Floor module, there exists a class JmgAbcensPreRegistre. It should be absence.
In class LedgerYearAccountDiskBel, there is a variable called transactionsWritenToFile. Written is the correct syntax.
In report SalesPackingSlip, there is a reportcontrol called invoiceLable.

Nitpicking, that's what it is. Some of these errors go years back, which proves renaming isn't always the easiest option. If it ain't broke, don't fix it.

Another trace of humans involved in coding, is the comments you find in the code. They range from type 'obvious' to 'funny'. Again, some examples:

Class LedgerAccrualTrans_Calendar
// so it won't loop endlessly!

Or class LedgerGeneralJournalService\find, which contains some tips from the programmer:

// Performance Gain:
// Another implementation could get all the daily journals that meet the criteria in one statement
// this.findList(_queryCriteria, ledgerGeneralJournal). Then, get another set with all the blocked
// daily journals in one statement. Then filter the result set set in memory. This implementation
// would be faster because we would not make so many database hits.

The same class, method read

// We need to verfiy a few properties before returning the journal.


// We are not passing the user group to this message by design because we do not want to
// leak that information. At this point in the development cycle, I can not create a new label.

Class SysExpression\buildXmlDocument

// ax did not like passing the static method call to the clr
// so we load the values into local ax types first

Class SysExpression\buildXPathDocument

// Prime the pump

(had to look that one up: to do something in order to make something succeed, especially to spend money)

Class SysLabelFind\doFormEditControl

tmpTreeNode = tmpTreeNode.AOTparent(); // so walk up the tree

And if you ain't got the time to complete the job, remind yourself (or fellow coder) to finish the job later:
Class SysLabelFind\doFormGroupControl

// TO DO find label of datagroup

I'm pretty sure there are a lot more geeky comments hidden in the code, so if you know any, share them in the comments!