The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
![]() Quote:
Quote:
|
#12
|
|||
|
|||
![]()
If you're going for shortest code, how about:
PHP Code:
Anyway, I'm not a php expert but I think I'd go for readability unless it's in a critical area where you're specifically worried about the speed. If the point is to make sure $totalthreads and $totalposts are a positive number, I'd probably go with PHP Code:
even if it's not "supposed" to ever be less than 0. (ETA: or on second thought maybe using max() would make the intention more obvious). |
#13
|
||||
|
||||
![]() Quote:
![]() Altough I could argue, that the addition is always called and therefore produces more cycles then a comparison :P However, this is way too little code to actually perform "real" optimization. In the end, it's the coders preferrence which is important and easier to read for himself. There are more grave issues of coding-crimes where I sometimes like to kick the developer in the face; how if/else and brackets are placed doesn't belong in this category tough. |
#14
|
||||
|
||||
![]() Quote:
|
#15
|
|||
|
|||
![]() Quote:
Quote:
That I don't know anything about, for php at least. ![]() |
#16
|
||||
|
||||
![]()
vb 4 use max in quite a few places in the code, which I had never noticed before.
It all really boils down to what we get used to in coding styles, I guess. There are always newer and better ways to do things, so change is inevitable. ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|