Re: Newbies Code: Please critique
Mo wrote:
> $fiveCells = "<td></td> <td></td> <td></td> <td></td> <td></td>";
Don't. If you need spacers in a table, do:
echo "<td colspan='5'></td>";
> $empContent = '<td class="empName">' .
> $empRow["signature"] . "</td>";
> $empContent .= "<td>OrderCount</td>";
> $empContent .= "<td>GrossSales</td>";
> $empContent .= "<td>GrossCosts</td>";
> $empContent .= "<td>GrossProfits</td>";
> print $empContent;
You will compact your code and make it more legible if you just output
everything from the beginning in those cases. There will be situations in
which you'll need to delay the output (as discussed), but in the code you
sent, there are lots of constructs like the one above. Try to avoid that if
you can.
Besides that, it's a long piece of spaghetti code - long, with no functions,
and quite a lot of nested loops. That, in the long run, tends to make code
ilegible. Please try to design your code so that it is more modular and
less spaghetti.
Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
Now listening to: Fly Gang - Calambre Techno - Te Gira la Cabeza (disc 1:
Sistema de Sonido) (1999) - [7] Feeling pt 1 (5:35) (86.750000%)
|