• Resolved Mostafa Shahiri

    (@mostafadeveloper)


    Hi

    I know using the recursive functions is not a traditional way of coding for many of web developers, but sometimes it is a very useful way for solving problems. Some web developers say that recursive functions increase resource utilization on servers and are not good ideas in practice. Is it true?
    I want to use a recursive function in my plugin but I don’t know is it allowed to use recursive functions in WordPress plugins or not?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Joy

    (@joyously)

    If the algorithm is best solved with a recursive function, then it’s okay to use that. But be very careful about them, and test thoroughly.

    Thread Starter Mostafa Shahiri

    (@mostafadeveloper)

    @joyously Thanks you for your reply. I want to use it for displaying some HTML tags like repeatable lists or some tree-like structures.

    Joy

    (@joyously)

    If you look at the core code for the Menu functions, there are classes that do that, recursively.
    Walker

    • This reply was modified 6 years ago by Joy.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Recursive function’ is closed to new replies.