IMHO: Testing the sum tells you nothing about the components but should be included following the test of each component.
-----Original Message----- From: talk-boun...@lists.nyphp.org [mailto:talk-boun...@lists.nyphp.org] On Behalf Of Leam Hall Sent: Wednesday, June 27, 2012 4:45 AM To: NYPHP Talk Subject: [nyphp-talk] Using greater than zero or multiplication? Morning all! I'm working on my Tech Dive Planner and wanted to get a best practice idea from you. There are some calculations that need 3-5 variables set or the calculation isn't done. Since all the inputs are numeric and set to a default of zero, is it better to test each input to see if it's greater than zero or just multiply them once and see if the result is greater than zero? In the grand scheme of things there's no serious performance hit either way, the app is pretty small. I am trying to build my skills and good habits though. Thanks! Leam _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show-participation _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show-participation