Welcome Guest, Not a member yet? Register   Sign In
Helper_array to class
#4

I could go either way with this one.

I don't feel that converting from plain functions to a class with static functions actually gains anything, except maybe some syntactical sugar, and not having to explicitly load the helper, which, true is a minor benefit. There isn't a performance benefit as I believe using static functions it comes very close speed wise, depending on the speed of the class autoloader vs the file locator to load the helper. And I'm not too concerned with polluting the global namespace on this since a) PHP is a plain function language at it's core and b) the framework encourages OOP behavior so I don't see clashing with user apps too frequent. I do think there's a tiny amount of added mental overhead since you have to remember to include the full namespace, so it basically becomes a wash in my book.

I do think there are some very minor gains if we make this change, but mostly it becomes a preference. I'm willing to go with whatever the majority opinion on this is.

However - if we decide to go this route we need to convert all helpers to classes for consistency sake. And for at least 1 major release the existing helper functions should be marked as deprecated.

In this case, the classes could stay within the Helpers directories they currently live in, alongside the existing procedural files until they're removed.
Reply


Messages In This Thread
Helper_array to class - by iRedds - 01-01-2022, 12:27 AM
RE: Helper_array to class - by kenjis - 01-01-2022, 01:54 AM
RE: Helper_array to class - by iRedds - 01-01-2022, 01:09 PM
RE: Helper_array to class - by kilishan - 01-01-2022, 09:22 PM
RE: Helper_array to class - by Chivinsdev - 01-03-2022, 08:27 AM
RE: Helper_array to class - by iRedds - 01-03-2022, 08:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB