Can someone tell me in their opinion if this is proper coding? The following code is the fix for the division by zero error.
I am replacing this:
Code:
if ($totalthreads == 0)
{
$totalthreads = 1;
}
if ($totalposts == 0)
{
$totalposts = 1;
}
With this:
Code:
$totalthreads == 0 ? $totalthreads = 1 : $totalthreads;
$totalposts == 0 ? $totalposts = 1 : $totalposts;
It works, but I am curious as to what your feelings are as to whether this is actually a proper way to do it or not.
Can anyone tell I got bored enough to do this?