[eluser]Josh Holloway[/eluser]
I'm writing code for a pretty intense website.
I've been using the profiler to check my execution times for some of the heaver load functions and I've hit a bit of a snag on one inparticular.
We're using 3D Secure to authorise debitcard payments (You know, the annoying further authentication required box from your bank asking for a password)
However, the size of the function is causing execution time to rocket to ~15 seconds.
My question is, in your experiences, is it better to use 1 large function e.g:
Code:
function some_function()
{
//large block of code here
}
or several smaller functions
Code:
function part_of_function()
{
//part of the whole function
}
function another_part_of_function()
{
//another part of function
}
function 3rd_part_of_function()
{
//final part of function
}
function call_all_functions()
{
//some logic here
$part_of_function();
//some more logic here
$another_part_of_function();
//even more logic here
$3rd_part_of_function();
}
I'd post my real code but there's a lot more about (900 lines from all libraries and models that make up the process) and would take a awfully long time to cut up and post whilst keeping the post short and interesting.
thanks