Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 19 Apr 2012 00:58:34 -0500 From: Leif Roar Moldskred Subject: Re: Wages not calculating correctly Newsgroups: comp.lang.java.programmer References: User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (Linux/3.0.0-17-generic-pae (i686)) Message-ID: Date: Thu, 19 Apr 2012 00:58:34 -0500 Lines: 35 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Lz8ulhioegmSC3FV0VqHHxRY3s2I0/R08KrsTWknfPyVnmGJemr9wjKBxdOoN+jGjFcSGFe5CBy9uhF!tLed3JdoB/OkjUyA4ipw4oXXzmySjyLN2c0sDluShelySUp6+4dqygw9umdtn2ji+eYMC2faZDk= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2663 Xref: csiph.com comp.lang.java.programmer:13655 Roedy Green wrote: > On Wed, 18 Apr 2012 13:53:39 -0700 (PDT), Simfonika Island > wrote, quoted or indirectly quoted someone who > said : > >>My program is not calculating the wages correctly. Can somebody please >>tell me why??? > > See http://mindprod.com/jgloss/ide.html > > If you single step trace you program, the problem should quickly > reveal itself. That's a terrible piece of advice to give to a beginning programmer. Interactive debuggers are useful tools, but you will waste a lot of time with them if they're the first thing you reach for when you find a bug. _Think_ about the bug. What type of bug is it? What's the failure modes? Is it consistent? Does it occur for all inputs, or just some? Is it timing based? Does it involve databases, network access or third party libraries? Read the logs (if you have them, and if not, put some in). Read the code. Locate the bug: Where in the code does the bug become visible? Where does it manifest? Where could it have been introduced? Divide and conquer -- which parts of the code have nothing to do with the bug, and which parts remain? Did it use to work before? (Are you certain?) What has changed since then? Is the program environment still the same? The build process? The dependencies? Still don't know what causes the bug? Fine, _then_ you can fire up the debugger. By now you should at least have a good idea of where the bug _isn't_, so you can concentrate on the parts that remain. -- Leif Roar Moldskred