On 14/12/2018 05:56, Peter Kokot wrote:
Now, if we imagine adding more classes in the application, yes, more complexity comes, but also more flexibility with testing, and using the code across the app. Currently we have functions used, mixing SQL, HTML, and PHP code in same files. Not to mention globals in some functions which is also an issue.
In the absence of any good current tutorials on how we should be using PHP, the website is a showcase of how it should, or perhaps currently how it should not be done? What was 'cutting edge' is now 'old school', but without any real incentive to be replaced simply because as with many legacy sites - it does it's job. There are many side tracks demanding changes to core PHP to meet their own agendas and I still treat 'typing' in that class as my own agenda is the flexibility of being able to create html pages without being 'strict' about how the content is sourced, only strict in VALIDATING the material that is finally displayed. If one wants a framework where the code is all 'preloaded' then go for a compiled language. Yes I know it may be faster if everything is already compiled, but my own web sites have a combination of common code and specialist functions. The PHP website is exactly the same, but as it has been built, every specialist area is it's own independent set of code. One can't use the one 'editor' package across every area which could then be pre-loaded. I find 'autoload' inflexible and 'composer' to much of a straight jacket because I want to select elements based on the current 'page' rather than loading everything every time. I am probably being too old fashioned, but I still like to be able to keep content isolated from style and from business code if only so I can select the right language from the database rather than having large chunks of it hard coded into the scripts. Nothing being promoted today leads me to change may way ... I still prefer the way PHP USED to work well ...
-- Lester Caine - G8HFL ----------------------------- Contact - https://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - https://lsces.co.uk EnquirySolve - https://enquirysolve.com/ Model Engineers Digital Workshop - https://medw.co.uk Rainbow Digital Media - https://rainbowdigitalmedia.co.uk -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php