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 751231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:38:36+00:00 2026-05-14T14:38:36+00:00

I dont know much about classes, but have a reasonable knowledge of PHP/MySQL. But

  • 0

I dont know much about classes, but have a reasonable knowledge of PHP/MySQL.
But why should I learn classes? I know they are important but what benefits can I see using them that I cant with?

  • 1 1 Answer
  • 0 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-14T14:38:36+00:00Added an answer on May 14, 2026 at 2:38 pm

    Actually, I’ve found that it is often simpler to use function-based programming in php than object oriented. There are a lot of ways in which just using function libraries and trying to keep your code simple and direct make your php scripts more maintainable, especially if you minimize state to increase reproducibility.

    Objects & classes are one tool that you should get to know so that you can choose between the different options, but certainly not the only choice, now that php 5.3 has first class functions, moving more in the direction of true functional programming is another tool that you could get to know.

    Php’s background is very function-based, a huge portion of the native language provided is functions and sometimes the square peg of objects doesn’t fit in php’s round hole.

    This certainly wouldn’t apply to Java, but php’s background is very rooted in functions.

    Edit:

    Let’s be clear, to be effective at php you will have to have a good grasp of objects, because you are going to encounter it frequently, and if you work for other people in php, you’ll probably have to write OO yourself on your employer’s behalf. So get to know it well. But don’t stop at OO and consider it the be-all-end-all solution. In fact, when it comes to dealing with other people’s bad php code, I have found solid function-based programming to often be a simpler tool for refactoring and cleaning up bad code.

    I would say there are a few ways to write php code:

    1. Bad procedural code (little reusability, probably uses functions, but not well, probably uses objects, but not well).
    2. Good function-based code (maximized reusability, minimized complexities of state, separation of concerns)
    3. Bad object oriented code (large multifaceted objects, complex hierarchies, etc)
    4. Good object oriented code (specific-task objects, clear separation of concerns like MVC)

    And eventually, as php 5.3 matures, we’ll be able to start throwing in a bit more functional programming into the “good function-based code” category and it will become an even more effective alternative. In the meantime, though, get comfortable with 2 and 4 because you’ll need ’em both.

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

Sidebar

Related Questions

I'm newbie to PHP and I dont know much about database. I have one
ok so i dont know much about sql but im trying to make a
I don't know much about the MS world, but now it happens to be
I don't know much about poking at servers, etc, but in light of the
I have built a horizontal scrolling website. I don't really know much about Java
I don't know much about the mechanics of how ORM tools work, but from
I don't know much about web development, so probably this question will sound exceptionally
I don't know much about multimedia development and am having some trouble comparing Silverlight
i don't know much about IIS, except it's a web server (just like apache)
I really don't know much about Apache, I followed some tutorials and installed the

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.