Search390.com Developer Tip June 6, 2001 ======================================================== Get free offers from reputable merchants for products that you are interested in. Pick from over 50 categories of interest, modify your profile at any time to suit your needs, and receive only the email that interests you when you subscribe today. Just click on the link below, and get your account up and running: http://search390.techtarget.com/postmasterDirect/ ======================================================== ======================================================== ENTER TO WIN A PALM Vx! ======================================================== Got a great tip? Share it with us, and you could win a cool prize. Search390 is offering a prize to the user-submitted tip that receives the highest rating each month. The winner of this month's tip contest will receive a Palm Vx ultra slim handheld. Weighing in at just 4 ounces, the Palm Vx has the same anodized aluminum exterior and LCD screen as the Palm V handheld, yet it has four times the memory of its predecessor, giving you more speed and more storage. To submit a tip, contact us at mailto:[EMAIL PROTECTED]. For more information and contest rules, click on http://search390.techtarget.com/tipsContest/0,289488,sid10_prz550161_cts550144,00.html ======================================================== TODAY'S DEVELOPER TIP: Data synchronization & integrity By Jim Keohane It's a commonly known programming rule to "minimize having the same modifiable information in two different places" in a program. A simple example might be a variable D that contains the number of dependents and another variable L that holds the COBOL subscript for the last filled entry in the DEPENDENT's ARRAY. You now require extra code wherever either variable is modified to keep the other variable in sync. There is a corollary that is not so obvious. It might be stated to "minimize occasions where the information in one variable can be easily derived from the value of another variable." One such case I saw involved a checkpoint/restart option in a file transfer product. There was a CHECKPOINT variable set to YES or NO depending on whether user wanted checkpoints taken or not during a file transfer. There was also an INTERVAL variable set to the number of seconds desired between checkpoints. If the user specified CHECKPOINT=YES and INTERVAL=120 then any broken file transfer could be RESTARTED from prior checkpoint with an average time loss of 60 seconds. The problem was that both variables, in addition to being set by user at installation, could be overridden dynamically during transfers and could also be changed due to error handling. I suggested the programmer throw out the CHECKPOINT variable and just test if INTERVAL > ZERO or not. If ZERO then there's no CHECKPOINT. He didn't see the reason for it and left it as is. Some months later he apologized after finally finding a very difficult bug was due to CHECKPOINT=NO and INTERVAL nonzero. Similar cases might be MARRIED=YES|NO and SPOUSE-NAME= value or SPACES. Less obvious is the case where two variables, DEBITS and CREDITS, appear along with OVER-PAYMENT and BALANCE-DUE. Conceivably you can do without the last two. How about an income tax record that contains SALARY-INCOME, GIFT-INCOME, ALIMONY-INCOME, etc. and then also has a TOTAL-INCOME with the sum of all the others. You might be asking for trouble or at least causing more code to be needed during maintenance. There are exceptions to this rule where performance is a major issue or where the logic involved is localized and not subjected to frequent maintenance. About the author: Jim Keohane ([EMAIL PROTECTED]) is president of New York consulting company Multi-Platforms, Inc. His company specializes in commercial software development/consulting with emphasis on cross-platform and performance issues. ======================================================================= DID YOU LIKE THIS TIP? Why not let us know? Email your comments to mailto:[EMAIL PROTECTED], or you can rate this tip by scrolling to the bottom of http://search390.techtarget.com/tip/1,289483,sid10_gci553878,00.html?dgExplicitTieredReg=&dgImplicitTieredReg=%3EttTaxonomy%3Esearch390%3EEmail%3ETips&dgOptInTieredReg=true&dgTieredRegLocation=Tips&FromTaxonomy=%2Fpr%2F286020 ======================================================================= ======================================================================= ADDITIONAL RESOURCES: * Do you have programming-related questions? If so, ask an expert. Search390 has two programming experts available to answer your questions, so ask away! Go to http://search390.techtarget.com/ateQuestion/0,289624,sid10_tax285034,00.html * For a list of the latest tips on Search390.com, go to http://search390.techtarget.com/tipsIndex/0,289482,sid10_tax286020,00.html * Looking to share thoughts and ideas? Have a problem that can't be solved? Then check out our Developer Discussion Forum. Designed with professional developers in mind, this forum is all about application development, scripting, database programming and other subjects of interest. Look through the variety of posts for a solution to a problem, or post a new message and be a 390 hero! http://search390.discussions.techtarget.com/WebX?50@@.ee83ff7 ======================================================== ======================================================== The Learning Zone Featured Book ======================================================== An Introduction to Object COBOL Author: E. Reed Doke, Bill C. Hardgrave Summary: With its use of straightforward language and real-world examples, An Introduction to Object COBOL is a concise and accessible introduction to using Object COBOL. You'll discover how object technology is applied and how the resulting Object COBOL code is constructed. All of the programs included in the text can be downloaded from the Wiley web site (http://www.wiley.com/college/). You are encouraged to execute and experiment with them. As you work with these programs and follow the related case study, you will gain important experience in using Object COBOL in a business environment. http://www.digitalguru.com/dgstore/product.asp?isbn=0471183466&ac_id=54 ======================================================== Disclaimer: Our tips exchange is a forum for you to share technical advice and expertise with your peers and to learn from other IT professionals. Techtarget.com provides the infrastructure to facilitate this sharing of information. However, we can't guarantee the accuracy and validity of the material submitted. You agree that your use of the ask the expert services and your reliance on any questions, answers, information or other materials received through the web site will be at your own risk. ======================================================== ======================================================== If you would like to sponsor this or any techtarget newsletter, please contact Gabrielle DeRussy at [EMAIL PROTECTED] ======================================================== If you no longer wish to receive this newsletter simply reply to this message with "REMOVE" in the subject line. Or, visit http://search390.techtarget.com/register and adjust your subscriptions accordingly. If you choose to unsubscribe using our automated processing, you must send the "REMOVE" request from the email account to which this newsletter was delivered. Please allow 24 hours for your "REMOVE" request to be processed.
