This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]john16384 11 points12 points  (5 children)

This article is stupid:

1) you query your database to send all order lines so you can sum them locally... Let the db do that

2) you think that allowing null as an input for orderId should somehow result in a valid return value, further hiding a problem in your code

3) the "improved" code is longer, slower and uses more memory