zend-framework versus Kohana versus Symfony [closed]
Asked Answered
H

6

9

Which one of this frameworks would you recommend to someone who knows the basics of PHP? What are the advantages and disadvantages?

Hylton answered 14/1, 2010 at 13:43 Comment(0)
A
15

I wouldn't suggest any frameworks to someone who knows just the basics. Instead, I'd suggest to get a firm grip on OOP and the most common Design Patterns first, because that is what you will find in these frameworks. It also doesn't hurt to know your way around the various available PHP libs and extensions.

Adar answered 14/1, 2010 at 14:8 Comment(8)
Agree with Gordon. No point jumping to any of frameworks when you barely scratch the surface. That precious time should be spent learning mysql, mysqli, PDO, string processing, RegEx, cookies, sessions, GD2 and of course OOP & Design Patterns instead of frameworks.Matta
I disagree. In fact, all senior developers in my team work on building frameworks and APIs while junior developers are much less prone to make mistakes when working with frameworks. God forbid if we didn't use frameworks the code would be all over the place. I settled with CodeIgniter after evaluating all of the above. Kohana is not a mature product--for example it doesn't care for backward compatibility which means it's good for learning but not for production.Logicize
@Logicize I don't believe frameworks make juniors write less erroneous code. If the juniors have no clue about proper OOD, they will write OO spaghetti code, e.g. a common beginner mistake with MVC frameworks is to create fat controllers and anemic models. This usually leads to code duplication, which basically is code all over the place. They also often favor inheritance and composition over aggregation. Or they code against concrete implementations instead of interfaces. Both leads to monolithic, hard to maintain structures. Frameworks help solve concrete problems, not write clean code.Adar
Those who don't use frameworks are doomed to re-invent them. Poorly. In my mind, using a framework will help you learn proper architecture, designs patterns, etc. Plus having a common grammar allows you draw insight from other programmers using that same framework.Azilian
@Bryan Let them reinvent them then. They will learn a lot from it. See this article brandonsavage.net/…Adar
@Adar it's a sliding scale. MVC is better than no MVC. Using 960grid or blueprint is easier than not using it. jQuery alleviates a lot of issues. In fact, once you write the basic interfaces and provide a few model controllers, the work flows a lot more seamlessly. Perfection is an endless pursuit but a good start makes it that much easier.Logicize
@Logicize There is no doubt frameworks are helpful. I am not saying not to use them at all. I am saying, when you are a beginner, learn the concepts, e.g. Design Patterns and OOP instead of framework Xs concrete implementation thereof. It's like learning proper English before talking a dialect.Adar
Before riding on a race bicycle, every bikers learned to ride on a small bicycle with helper wheels to learn the basic of pedaling and balance, why should the programmers burn the steps? I have learn php the hard way and now I am really happy to be using a framework(Zend to not mention it). I did the same with javascript (learn to build an ajax request by hand for example). Then when you have issues, you have a wider view on what could be the problem since you know what elements are involved (and btw +1 to Gordon)Salespeople
S
6

I think frameworks are a double edged sword for beginners. You may be able to do more in less time in many cases but in other cases (not a few) you will make mistakes because you do not understand the complexity of the framework code. I think you should be able to read a framework and understand its architecture if you want to use it.

That said it seems that the real cracks use Symfony. It might become or might already be the best, most versatile, most powerfull framework out there. But it definitely needs a lot of understanding of the principles of programming as well as web techonology and server technology in general.

Also very powerfull and much easier to start with is Zend Framework. It can definitely do much more for you than Kohana.

If you want a lightweight framework, Kohana is a good choice too. It has come a long way the last months and I think it is rapidly establishing itself as the new lightweight favourite.

So all in all, the three frameworks you mentioned are the three top frameworks on the PHP framework market at the moment and you won't make a mistake with any of them.

Sobriety answered 19/1, 2010 at 19:10 Comment(0)
S
4

UPDATE: It is now 8 years later and Kohana is no longer maintained. Laravel would be my current recommendation for a relatively simple yet very powerful PHP framework.


Even though ZF is well established and well documented, I would suggest Kohana since it is quite a bit less complex. It is very easy to start tinkering with it by simply downloading or cloning the sample application from github.

Symphony is not for beginners. I disagree that frameworks in general are not for beginners. Starting with a blank file and no framework leaves all of the architectural design up to someone who has no idea what they are doing while starting with a lightweight framework like Kohana gives you a well-organised platform and documentation to hit the ground running. Learning OO without any examples to guide you is very difficult since you don't already know what good OO design looks like.

After downloading/cloning the Kohana sample app, hit the docs and you'll be writing well-designed OO code in no time.

Stormystorting answered 19/1, 2010 at 18:52 Comment(1)
Kohana is no longer maintained and besides I think Laravel is a lot better so that would be my current recommendation.Stormystorting
W
1

For a beginner and using the three examples you gave I would say start with Kohana(or Code Igniter) for these reasons.

  1. It's a lightweight framework which is a good starting point for full PHP development because it serves as a guide in how to organize a project in a language that doesn't have a lot of structure on it's own
  2. Introduces basic MVC concepts.
  3. Has basic features that will be useful in any PHP project e.g. caching, data filtering etc

I would then move on the Zend Framework if you plan or strive to work on larger projects for these reasons:

  1. Kohana documentation is greatly lacking (it's manageable for a beginner because you end up poking around and see what makes a framework tick so that they don't see like this ominous holy code which is a plus; but in a major project with timelines it's annoying)
  2. Kohana enforces certain conventions which is often inconvenient in major projects
  3. Lacks mature features that are useful in "enterprise" development e.g. a decent unit testing system (there is rudimentary phpunit modules to use in Kohana and you can certainly use base PHPUnit but in contrast Zend Framework has extended PHPUnit functionality to better suite it's framework)
  4. Better support. Zend framework has the Zend Company behind it as well as a huge community. This is a huge win for them because it permeates in everything about the framework e.g. configuration is thought out much better in Zend framework,more robust security featues, proper class autoloading based on PEAR namespacing, and it has a plethora of contributed components. Some of these benefits you can shrug of when starting but become invaluable when taking on large projects.

I've not used symfony but from what I can tell that also has some useful features once you get more versed in PHP (better ORM, better scaffolding etc). Synopsis: Kohana is a good start but I'd advise against roosting there if you plan to get into PHP beyond small sites.

Wolfie answered 24/1, 2010 at 16:46 Comment(0)
R
0

In your case I would go with (in this order):

  1. Kohana
  2. Zend Framework

Since they are easier to pick up (specially for a beginner) than Symphony.

Recreate answered 14/1, 2010 at 14:3 Comment(0)
E
0

I always wondered why people say that not providing a unit test system is a major drawback in a framework. Well, testing you app is your responsibility and you should use the tools you're most comfortable with. Me, for instance, prefer SimpleTest and are bothered with framework that come bundled with and promote the use of their own testing system. Why learn another unit test system when SimpleTest is more than enough?

Notice that providing a unit test system and unit testing the framework is two completely different things. The framework should be unit tested, period. But for this task, the developers of the framework may use the tool they prefer most. They may even roll their own test framework (it seems that some people never learn and keep reinventing the wheel). However, (IMHO) the framework test should be kept separate from the framework itself. It shouldn't even be included on the framework tarball, but be kept as a separate package that interest only to developers of the framework.

Just my 2c.

Enroot answered 15/9, 2010 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.