Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 885937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:59:22+00:00 2026-05-15T12:59:22+00:00

i want to know the best way (faster and better) to structure the code

  • 0

i want to know the best way (faster and better) to structure the code in PHP.

Some people save a Master Class with functions, sub-classes and var’s into an unique global variable, like $modx CMS case.

What are your structure techniques?
And how do you connect to your DB?
Do you all prefer PHP Frameworks like PHPCake?
How do you structure Plubic vars (configuration) and Private vars (temporary or program running vars)?

The reason for my questions is that i wan’t start programming staticly, with a strong base. Currently i’m programming with ModX framework/CMS.

NOTE: Please justify each time you vote -1 on a answer!

Thanks in Advance
(Sorry for my poor English)

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:59:22+00:00Added an answer on May 15, 2026 at 12:59 pm

    Faster and Better do not go together.

    Faster

    Pure PHP is faster and more compatible. Your distributions will be smaller. Is it the easiest to maintain? Well, it can be if done correctly. Large software projects like Drupal or WordPress show that Framework-based projects are not any easier to maintain than pure PHP. Pure PHP still has some built-in classes, but these ultimately wrap back to functions. Autoloading is nice but larger codebases still take a performance hit.

    Better

    Framework-based projects tend to be better to maintain and work with in the long run. They are slower due to their nature (autoloading has a performance hit if you have a lot of different paths in your include path, or a badly ordered include path). It also gives a preset structure so that others can jump in and understand what is going on quicker. Most Zend Framework projects look the same, so you’ll have a better chance of finding what piece of code is running. There’s a performance hit and external helpers like opcode caches are required.

    My Opinion

    Go with the ‘Better’ option: a Framework with autoloading. A lot of the work has been done already for you so you will be out of the gate faster in terms of production time. Right now I suggest the Zend Framework plus Doctrine. Is it the fastest? No, but it is easier to maintain.

    If you need flat-out speed, go core PHP or a roll-your-own low-level framework. ZF, Code Igniter, symfony, they all take a performance hit compared to core PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know the best way to do a PHP IF OR statement..
Bascially I want to know the best way to hide/show an ASP.NET control from
I've been at this for a while and want to know the best way
I want to know the best way how to obtain the basic info of
I want to know the best way to compare two objects and to find
I want to know the best way of testing data access functionality. I know
I want to know the best way to mark up tabular data on a
I want to know the best way to parse XML , i.e in terms
I want to know the best way or a tool for making a good
I want to know the best way of transferring a cryptographic initialization vector (IV)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.