Bizarre code
Collapse
X
-
$test = ($something > 0 ? 'true' : 'false');
which is what the iif funciton is?!Comment
-
Hi Derfy,
What would be the point of writing a wrapper function for a build in core language feature? Why not just always use the language feature directly?
Which of these is the best way to echo "Hello World"?
PHP Code:function myAmazingEchoingFunction($text){
echo $text;
}
myAmazingEchoingFunction("Hello World");
PHP Code:echo "Hello World";
Comment
-
It allows an optional second parameter, and simplifies the code reading for anyone who isn't a PHP guru.
It's depreceated, which means they remove them as they come across them. They are causing bugger all slowdown, so it is a waste of resources to search through the code to replace them.
Seriously guys, if we're going to nitpick, choose something worthwhile.Comment
-
Hi Dilly,
This raises a number of points. Firstly, I don't think that you have to be a PHP 'guru' to understand how if statements work. Secondly, I think that in order to read through the vBulletin code in the first place someone would have to be at least above a basic level of PHP understanding.
Why do they remove it as they come across them? Why not just look for them and remove them?
I know that just running this code or my stupid examples above won't cause any noticable slowdown or any significant load, but what about when there are a thousand or so users online, all posting because they're excited about the same thing. Every little bit of optimisation helps; I'm not saying that we should go through the code with a fine toothpick and spend months and months working out the best way to optimize various bits but there are many unoptimisations that seem to have been made in vBulletin for no justifiable reason what so ever.
I think this example is a good one as it is called so many times throughout the rest of the code. Similarly, this isn't the only unoptimisation (see above rants), together they have a cumulative effect. The example is indicative of a much wider problem.
Next. Why do we want a ternary if function that takes an optional third parameter? Why not just use the standard core if?Comment
-
Maybe someone can explain something to me.
Using vBulletin 3.7.0 beta 4 now.
In the 'user' table the IP addresses are stored using dotted decimal format xxx.xxx.xxx.xxx , in the 'post' table it is the same.
Why then, do we break from this tradition in the 'visitormessage' table and store them as converted decimal?
192.168.0.9 becomes 3232235529 etcComment
Related Topics
Collapse
-
by imahawkiIf you agree please like this post even if you don't feel like responding.
I understand this has previously been a hot topic. I'm not sure if it still is. If people have given up is it...-
Channel: vBulletin 5 Connect Feedback
-
-
by mangozI hope that this post will help the massive confusion about reputation ("likes" but that's a silly not intuitive name that is too tough to search for so vbulletin should also quit using that...
-
Channel: vBulletin 5 Connect Feedback
-
Comment