"I was put on a new Microsoft Access project recently," Stuart A writes, "and I've slowly been finding my way around the system as the need arises (read: as bugs are reported). As my eyes drifted over the numerous modules, one stopped me in my tracks. It was a module named 'modHmm'. I guessed the programmer was in a ponderous mood?. So naturally, I had a look inside..."
Option Compare Database Option Explicit Global t1qq Global t2qq Global t3qq ...
"The file started off as usual," Stuart continued, "Globally declared variables without types that were poorly named and to be used who-knows-where. It was pretty standard stuff for our modules. So I continued looking..."
Public Sub UpdateThing() Dim adoRst As New ADODB.Recordset Dim comRate As Double adoRst.Open _ "SELECT * FROM view91 WHERE Transaction_GLAccount_Code = '12055'", _ Application.CurrentProject.Connection, adOpenStatic, adLockOptimistic, adCmdText Do Until adoRst.EOF adoRst!Transaction_GLAccount_Code = "12056" adoRst.Update adoRst.MoveNext Loop adoRst.Close End Sub
"Okay. So the function names were turning out to be as descriptive as the module name. Fine. But then I saw..."
Public Sub dude() Call sbWriteGLTransaction("2003CD1182", _ "Cheque Sent Bank", Fdate("2002-07-10"), -4097.47, _ "Dealer: Diner's Club", glClass.Company_Code, "12025") Call sbWriteGLTransaction("2003CD1182", _ "Cheque Sent Creditor", Fdate("2002-07-10"), 4097.47, _ "Dealer: Diner's Club", glClass.Company_Code, glClass.GetGLCode("CR")) End Sub
"Dude?!" Stuart wrote, "not only Dude, but that but Public Dude?! What are we doing?? My eyes continued down the page..."
Public Sub hhhhhfjhskjfds() Dim rst As ADODB.Recordset Set rst = useADO("View57", 2, , , 1) Do Until rst.EOF Call ocClass.setDateCompleteOnConsignmentItem( _ Format(rst!StockMovement_Date, "dd/mm/yyyy"), _ "Stock Written Off", , _ rst!OnConsignmentItem_OnConsignment_ID, _ rst!StockMovement_StockNumber) rst.MoveNext Loop End Sub
"I'm stunned!" Stuart added, "the rest of the functions were similarily named: jklsadjflksd(), ggggg(), ddd(), etc."
"Hmmmmm, indeed."