Thread: players in room
View Single Post
  #24  
Old 08-22-2003, 12:51 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Tseng


Neater? Subjective. I find it neater to have a balance of lines and lengths. You find it neater to have one check per line. When they are related (as they are in this case), I find it unnecessary to split it up. Perhaps I should paste the first line of the first if check in the hpfunctions subroutine on graal2001, and ask if those shouldn't be split up.

One line of two related checks (an event and a condition) and splitting them up one to each line is the same code - so you can't really argue efficiency or optimization, but only a stylistic choice.

(Additionally, the standards thread does not mention putting an event and a condition on separate lines.
I also find it more efficient to have one check per line in MOST cases. It adds flexibility to a script. You can add in additional commands and statements very easily as compared to having multiple checks in your if statement.
Reply With Quote