NYCPHP Meetup

NYPHP.org

[nycphp-talk] Using greater than zero or multiplication?

Leam Hall leamhall at gmail.com
Wed Jun 27 04:45:04 EDT 2012


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



More information about the talk mailing list