Signed up: 10 years ago (10/05/04)
Last signed in: 2 months ago
Friends78 Friends
Ben Cast & Crew
Ben Cast & Crew
Programmers out there!This weekend I've been looking into PHP frameworks. Everyone raves about them, so I thought I might as well read through a bit of a documentation (I say a bit, really it's pages and pages and pages).

So far I've looked into CakePHP, Symfony, Laravel, Zend and Kohana. Whilst I like the idea of switching to MVC-based development (would make REST APIing easy) and URL routing is rather nice, I keep coming back to one issue in the back of my mind:

All these things are going to be bloated and slow as fuck.

Can anyone else who's worked with them offer an opinion? Over the years I've built my own toolset for things like encryption, cookie handling, input sanitisation, etc etc. I've already designed the wheel, so to speak, so switching to a framework doesn't really change anything for me. I think primarily what I'm searching for is a way to just switch to MVC, but surely I can do this super quickly by myself without the aid of a framework?
3 years ago  |  Comments (15)  |  + 32 Cool
15 COMMENTS Sort by Likes · Date
#1  Posted 3 years ago  |  - 19 Flamebait
KWierso Sponsor
Shut up.
#2  Posted 3 years ago
I do what I want
#3  Posted 3 years ago
I'm not an expert on MVC, but it seems like it would depend on how integrated your existing code base is. If they're interdependent right now it would be difficult to separate them, but if you've kept everything modular it shouldn't be too difficult to switch no matter what language or framework you use.
#2  Posted 3 years ago
Your main issue here is PHP - really it's not a good language. I understand existing codebases make switching language impossible a lot, but trust me, run from PHP where you can. It's a tangled mess of bad design.
#3  Posted 3 years ago  |  + 1 Ditto
Kriist Backer
you got some examples of how php is not a good language, and if so examples of better languages?
#6  Posted 3 years ago
There are a lot of examples as to why PHP is a poor language - obviously that site has to be taken with a grain of salt, but it largely highlights PHP's ad-hoc construction, where things like object orientation have been forced into a language not designed for it, without breaking backwards co...
#7  Posted 3 years ago
BaphometLt Sponsor
CakePHP is a lightweight framework, with good MVC principles, URL routing and easy way to implement your own components that you already made. It's great if you want to generate something quickly and for small personal websites
Implementing existing website with cakePHP would be hard, and for such big website there could be a lot of optimisation issues. Just my opinion after using it for about 6 months.
#4  Posted 3 years ago
Holly Sponsor
MVC doesn't necessarily need a framework to be implemented. It's more of an architecture for how you set up your code than a framework.

As long as the interdependent code is clearly defined and divided, you can use jQuery to delegate the code's responsibilities accordingly. Then you can implement the code with something as simple as a CSS stylesheet, and use Ajax or cookies for persistence.

Whenever there's way like these to solve programming problems using easily writable code, I don't see any reason to use per-established frameworks.
#5  Posted 3 years ago  |  + 1 Ditto
What you're looking at is a careful balance between maintainability and the cost of overheads. Of course, it all depends on the context. If performance is EVERYTHING, then the overheads are costs you can't afford. For most other situations, the overheads are an acceptable loss.

As for specific frameworks, Zend and Symfony have been proven, by industry, to be strong frameworks for industrial use.

If you don't already read it, programmers.stackexchange.com has a lot more information on this topic, and will be able to give far better answers than the people of the Rooster Teeth community - fantastic as they are.
#6  Posted 3 years ago
Oh, and as for Kohana: while it's a very good framework with good extensibility, tools and all that jazz, the documentation is very poor; they advise you to read the source code instead.
#1  Posted 3 years ago
I recently moved from PHP to Ruby. Rails specifically is great for MVC, and it's relatively easy to implement complex stuff, considering how well documented it is and how consistent the conventions in Ruby are across frameworks.

Your main issue with it would be deployment, since it takes a bit of work if you use Apache, but it's definitely possible.
#7  Posted 3 years ago
Radius55 Site Admin
Ah, all I've got is a few years of Java and C, and a bit of HTML. Never really got into web design.

Good luck learning it, though.
#8  Posted 3 years ago  |  - 4 Noob
zeel01 Time Lord
I am a firm believer that anything worth doing with a framework is worth figuring out a way to do myself.

The framework designer found a way to do it, so why can't I find a way, that doesn't involve bloat/someone else's code to work with. So I would definitely recommend that you find your own way, relying on a framework might save time now, but it will suck later.
#9  Posted 3 years ago
You mention the percentage of features used in the processing of a request being low meaning the overheads are not worth it. However, experience tells me that plenty of frameworks can be trimmed down to the essentials (core stuff and what you need) without any damage to functionality, speed or...
#5  Posted 3 years ago
zeel01 Time Lord
Yes you can trim it down, you would need to decide if the time spent trimming is worth the over all benefit. I'm afraid there is just far more that needs to go into deciding this than a message board discussion can deal with.

I think Ben will have quite a bit of work just determining the best c...
#6  Posted 3 years ago
Baillie1987 Sponsor
I literally have no idea what any of these things mean
#10  Posted 3 years ago
Genek818 Sponsor
Well...Joel makes pretty good cookies...xD
#11  Posted 3 years ago
ACiDaRiS The Ruiner
I would suggest taking one or two of the frameworks for a test drive -- recreate a common system using one of the php frameworks, and use something like jmeter (a java based tool you can use to simulate load on a server) to fire up a bunch of threads to use the normal version and the framework version. You can time how long a request takes on average in both systems. See if the performance hit is large enough that it would seriously impact the site if you were to use it.

On the subject of MVC: I like MVC because the separation helps make a clearer distinction between what code does what job, and allows me to more easily reuse the same Model code across different Views. It also allows you to better make automated tests for your code to make sure when you change something, you don't break something else along the way.

As wikipedia will tell you MVC doesn't REQUIRE a framework, and you will be able to accomplish MVC methodologies without one, but it's possible a framework will accomplish what you want in cleaner ways than you would on your own.
#12  Posted 3 years ago
rupertjeff Sponsor
We use CodeIgniter at my office and it's not only lightweight, but it also makes app development very easy. I was hesitant at first myself, but after using it for almost a year now, I wouldn't want to start a project from scratch OR use any of my own home-brewed code.
#13  Posted 3 years ago
I don't like using any kind of librarys or frameworks, they probably don't slow things down much but I prefer to always write code myself.
#14  Posted 3 years ago  |  - 1 Lame
washyboy Geek
if what you're looking for is to make RESTful APIs more easily in PHP, then try www.slimframework.com/
#15  Posted 3 years ago
Please sign in or sign up to post a comment.