Jump to content

Recommended Posts

People keep talking about OOP, and I just can't see the ligth. Why use classes, and in all my php projects, I was successful without using php classes.

 

I have made an entire forum, and I have it on my site, and I havnt used classes at all.

 

If it is for the ease of it then show me. I just don't understand...

 

Considere this question a help in php.

Link to comment
https://forums.phpfreaks.com/topic/66443-solved-help-me-see-the-light/
Share on other sites

It just helps to create logical groupings for similar code. It also gives you the ability to create complex datatypes. The other big advantage is its reusability. With classes you can drop your code on a new application and take off knowing it works and not rewriting code.

 

That being said OOP is still procedural programming in a lot of ways. Yes you have objects that represent things and perform special actions but it's still down pretty sequentially as opposed to an event driven environment like .NET.

Wouldnt that make you lazier in php?

 

I mean you create a class for a file upload, then whenever you make a site with a file upload, you just drag and drop the code. Coding over and over again makes good practice..

 

Correct me if I am wrong though...

You're wrong.

 

Why would you ever want to rewrite code? You do it right the first time and then you forget the details of how it works. This gives you the ability to drive out efficiencies in your own development processes in methodologies so that you can more quickly develop complex applications. Furthermore, having a set of classes makes maintenance easier moving forward because you're always working from a common framework/environment.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.