From: "Judson McClendon" Newsgroups: comp.os.msdos.djgpp,alt.comp.lang.learn.c-c++,alt.lang.basic References: <8E0A6B90Bjsampsonpostmasterco AT news DOT earthlink DOT net> Subject: Re: A small bussiness billing application Lines: 46 X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Message-ID: Date: Thu, 22 Jul 1999 08:43:38 -0500 NNTP-Posting-Host: 209.214.105.42 X-Trace: news3.mia 932650990 209.214.105.42 (Thu, 22 Jul 1999 09:43:10 EDT) NNTP-Posting-Date: Thu, 22 Jul 1999 09:43:10 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Joe Sampson wrote: > >I have decided to write a program that will help my mom with her >accounts receivible billing at the end of each month. ... > >I will be writing this program in c++ or basic (whichever >language I can "lift" things out of tutorials better) ... Any programming tool that does not support scaled decimal variables is unsuitable for handling money. Just run this little QBasic or QuickBasic program that counts from $0.00 to $1.00 by pennies and see why: FOR I = 0 TO 1 STEP .01 PRINT I; NEXT Writing financial applications in C/C++ is about as smart as writing a compiler in COBOL. The vast majority of business applications are not written in COBOL because business are stupid. It is because COBOL is the only language designed specifically from the ground up to write business applications, and it is still the very best tool available for writing core financial applications. PL/I took many of COBOL's features, but it is a huge language to learn, where COBOL is simple. I've written in many languages including C/C++ and a lot of BASIC (since 1975), but they are both poor choices for financial applications. If your BASIC supports scaled decimal variables, such as PDS 7.1 or VB 6, but NOT QBasic or QuickBasic 4.5, then it might be suitable. PDS 7.1, for example, only provides for 4 decimal places in its CURRENCY type. This is fine for money amounts, but insufficient for many things, such as monthly or daily interest rates, or for pricing certain items. VB 5/6 support a DECIMAL type that is okay. Money is accounted in decimal arithmetic, and no auditor is happy when confronted with rounding errors caused by internal binary/decimal conversions. Don't screw around were money or lives are concerned, and use a tool well suited to the task. -- Judson McClendon judmc123 AT bellsouth DOT net (remove numbers) Sun Valley Systems http://personal.bhm.bellsouth.net/~judmc "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."