Jump to content

[SOLVED] Scripting or OOPHP


grungefreak

Recommended Posts

I have been away from PHP for a while. When I was  last using php (about 3 years ago), most people weren't using the object oriented version. Has this changed or are we still mainly using procedural php? I am about to embark on a web dev project using php and just wondering whichever is most popular now for support reasons.

 

Any opinions welcome.

 

GF

Link to comment
Share on other sites

I don't think you should base your application on whichever code is "more popular".

 

I personally prefer OOP because it's neater and gives a lot more functionality to...functions. I also find it useful because functions can use the same variables without having to global/define everything.

 

But if you don't actually need any of this functionality then there's not much point in using classes. A simple function will suffice.

Link to comment
Share on other sites

Usage of OOP is up to the user and the application.  In complex applications where a lot of functionality is re-used, it is smarter to go the OOP route.  For simple applications, it may not be worth the effort to build out a large framework when the procedural method will suffice.

Link to comment
Share on other sites

For me it's all about future.

 

OOP/Framework is investing time right now to have less work to do tomorrow when the site will grow. If you expect any project to grow big and have a lot of change/visitor, go for it. For a site/project that will never grow you loose your time by going OOP.

 

On the other side scripting as you call it, is fast to develop small project, but just like a credit card it will hit you and you will pay 3 time more if the project eventually grow.

 

I usually ask the client what he want. Pay more now and less later if the project grow, or pay less now and lot more later if the project grow.

 

Link to comment
Share on other sites

Thanks guys, that gives me a good idea on what way to go then. Think i'll just learn oo php and try use it wherever I can. OO is definitely here to stay and I guess one could draw some patterns based on classes and objects for use with other languages in the future.

 

GF

Link to comment
Share on other sites

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.