Jump to content

Recommended Posts

Hello,i have never used frameworks or learned object oriented code (idk if this has to do with anything) but i basaically kind of want to learn how to use frameworks but idk if i should finish a current project or hold off and learn frameworks and oop. But the current project only has the layout done and my Question is it easy just to convert the layout to a framework. Write now im using a include layout with PHP.

Link to comment
https://forums.phpfreaks.com/topic/267771-getting-started-with-frameworks/
Share on other sites

Meh. Depends.  Do you want to learn PHP or build an application?  Frameworks do all the boring important shit for you (sanitation, routing, et al), while doing procedural code teaches you to read the manual and figure out why you're doing what you're doing.  At the other end of the spectrum, if you start your php learnings with a framework, you'll only understand a framework and not PHP.  So... meh.  depends.

Depends upon what you mean with "faster"?

If you're wondering if you can develop faster with a framework; Quite possibly, depends upon the project really. If you're thinking about execution time, most likely not; There's a lot of code involved in a framework, after all.

I still recommend you to learn OOP, as it's a very powerful concept.

Also, on a general basis you don't really care much about the execution time difference between home-grown and framworked code, and especially not with procedural vs OOP. What you're really looking for with frameworks is how much time and effort they're saving you when developing, and if they add any extra security. That is what frameworks are made for, after all.

 

In fact, the code you write yourself (independent of the use of frameworks) is going to be the real measure of execution time. Write bad code and it's going to be slow, be it procedural, OOP, frameworked or whatever else.

So using a framework is also alot more safer?? What can you do in terms of security with a framework that you cant do without one??

 

"Alot safer" is relative, but the basic answer to this is yes.  The benefit of using a framework is the multitude of eyes that will see the code - thus it is subjected to scrutiny and improvement.  The general purpose of frameworks vary, as some take extraordinary steps in some areas, while others may not.  Consider codeigniter. The system will respond to any and all server requests within it's control.  Contrary to that, symfony requires that you 'white-list' particular routes, else they are met with failure.

 

Frameworks are meant to kill the task of setting an application up, if you don't know what that means, take a look at any framework's bootstrapping process: Symfony / CodeIgniter

  • 4 weeks later...

So using a framework is also alot more safer?? What can you do in terms of security with a framework that you cant do without one??

 

Everything the framework can do, there's nothing special about them. They're written using normal PHP code, by people that (generally) know what they're doing. The only difference is that someone's done all the thinking, programming and testing for you, which is the whole point of a framework. It frees you up to concentrate on the features of the application.

 

Obviously the first time you use a framework that's probably not the case, because you'll constantly be referencing the API documentation. Once you're comfortable with it though you can knock features out really quick.

 

As mentioned though, before you jump into a framework it's worth gaining at least a basic knowledge of OOP.

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.