Personally, I would use a framework. It will help you to structure your application and will reduce the amount of work that you need to do as the framework will make certain tasks simpler.
If it is your first time working with a framework then you may find that it will take longer to develop as you have to learn how to use the framework, and this may involve learning new paradigms and patterns. If you can afford to invest the extra time in learning to use a framework then I strongly urge you to do it; chances are you will appreciate working with a framework, and at the very least you will learn a lot!
'Frameworks' is a somewhat vague term. There are lots of different PHP frameworks and while they all aim to solve the same sort of problem (roughly) they each go about it in different ways. Web frameworks can be broken down into two broad categories: frameworks that do everything, and microframeworks.
Symfony and Codeignighter are popular PHP frameworks that fall into the first category. These aim to provide everything you need: Routing, database access and ORMs, templating, etc.
Microframeworks are much smaller and usually impose less restrictions on you (for better or worse). Microframeworks often only take care of routing (matching a URL such as http://example.com/users/pheter to a function that handles the request). It is then up to the developer to use other standalone libraries to provide the rest of the functionality that they need. Personally, I prefer this approach as I find it to be simpler. My current toolkit consists of a bespoke microframework which is similar to Slim, Twig for templating and Paris for database access.
However, while microframeworks are great for getting started quickly some people find their lack of features limiting, particularly as a project progresses.
I realise that I have digressed into discussing the merits of different types of frameworks so to come back to your original question with a TL;DR:
Yes, I strongly suggest that you use a framework if you can afford to invest the time to learn. I recommend that you play around with a few different frameworks to get a feel for how they vary and which appeals to you. Using a framework will reduce the amount of time that you spend reinventing the wheel, and may also decrease the amount of bugs and security issues that you might introduce as you ultimately have to write less code.
Oh right, from your previous comment I thought that you wanted to get rid of them but were having a hard time doing so because of how much they cost. You're right, it doesn't make sense to get rid of a chair that is functional and comfortable!
Thanks; I'm inclined to agree that it's a suitable trade-off for more readable code.
Could you expand on what you mean by "A lot of the static methods you see could also be short-cuts into the class's constructor" please. If the applications code is calling static constructors, as opposed to using 'new' then the dependency still remains - or have I misunderstood?
I love how clean and expressive the syntax is. My only concern is the use of static classes for everything which are essentially globals.
I'm not sure if this would become much of an issue but I'm interested in what other people think. Could it become a source of frustration later down the line? Or is it okay for a framework to integrate itself at the global level?
I'm really happy to see that this has finally happened! Many thanks to those involved in making this happen.
Is anyone else having issues getting this working with Symfony?
Personally, I would use a framework. It will help you to structure your application and will reduce the amount of work that you need to do as the framework will make certain tasks simpler.
If it is your first time working with a framework then you may find that it will take longer to develop as you have to learn how to use the framework, and this may involve learning new paradigms and patterns. If you can afford to invest the extra time in learning to use a framework then I strongly urge you to do it; chances are you will appreciate working with a framework, and at the very least you will learn a lot!
'Frameworks' is a somewhat vague term. There are lots of different PHP frameworks and while they all aim to solve the same sort of problem (roughly) they each go about it in different ways. Web frameworks can be broken down into two broad categories: frameworks that do everything, and microframeworks.
Symfony and Codeignighter are popular PHP frameworks that fall into the first category. These aim to provide everything you need: Routing, database access and ORMs, templating, etc.
Microframeworks are much smaller and usually impose less restrictions on you (for better or worse). Microframeworks often only take care of routing (matching a URL such as http://example.com/users/pheter to a function that handles the request). It is then up to the developer to use other standalone libraries to provide the rest of the functionality that they need. Personally, I prefer this approach as I find it to be simpler. My current toolkit consists of a bespoke microframework which is similar to Slim, Twig for templating and Paris for database access.
However, while microframeworks are great for getting started quickly some people find their lack of features limiting, particularly as a project progresses.
I realise that I have digressed into discussing the merits of different types of frameworks so to come back to your original question with a TL;DR:
Yes, I strongly suggest that you use a framework if you can afford to invest the time to learn. I recommend that you play around with a few different frameworks to get a feel for how they vary and which appeals to you. Using a framework will reduce the amount of time that you spend reinventing the wheel, and may also decrease the amount of bugs and security issues that you might introduce as you ultimately have to write less code.
Picture books?
Oh right, from your previous comment I thought that you wanted to get rid of them but were having a hard time doing so because of how much they cost. You're right, it doesn't make sense to get rid of a chair that is functional and comfortable!
Reading about the sunk cost fallacy may persuade you otherwise.
Thanks; I'm inclined to agree that it's a suitable trade-off for more readable code.
Could you expand on what you mean by "A lot of the static methods you see could also be short-cuts into the class's constructor" please. If the applications code is calling static constructors, as opposed to using 'new' then the dependency still remains - or have I misunderstood?
I love how clean and expressive the syntax is. My only concern is the use of static classes for everything which are essentially globals.
I'm not sure if this would become much of an issue but I'm interested in what other people think. Could it become a source of frustration later down the line? Or is it okay for a framework to integrate itself at the global level?
Does anyone know what font 'London 2012' is set in?
End of this list.
Back to top