Home > kohana > Kohana – A Review of the Good, Bad and Ugly

Kohana – A Review of the Good, Bad and Ugly

I’m approaching the launch date for my first site based on Kohana and feel it’s time to spill the beans. Somebody posted on the forums today and asked why Kohana isn’t more popular when compared to Cake, CodeIgniter, Zend or Symfony. The simple answer is that it’s not meant to be.

Kohana claims to be easy to use but this implies that it’s easy to pickup, it isn’t.

Kohana’s documentation sucks. The information on the official site is woeful, out-of-date and needs to be supplemented by forum searches and some heavy Googling. When you do find an answer, it’s also likely to be related to a different version of Kohana.

Kohana releases a lot of updates and without a changelog it’s hard to keep track. This means that upgrading your site from one version to another is both dangerous and time-consuming. It’s a bit like knitting with cocktail sticks while juggling chainsaws.

However, Kohana does make sense and once you’ve learned how it works you’ll enjoy it. You just need to climb that steep learning curve, I recommend some ice picks and crampons because it’s tough going.

If you want to use Kohana for your next web site I recommend that you pick a single version and forget about upgrading it for a year or so. Each version is stable so you don’t need to patch vulnerabilities. As the changelog is missing and there’s no good information for upgrading, I’d simply skip the stage. After all, you just don’t need it unless there is some killer feature you need. We’re also about to go through a big leap moving from v2 to v3 so if I was starting a new project, I’d start in v3. I see no reason to use v2.4 unless you like stapling your eyeballs together and really, really need to upgrade from an earlier release of v2.

Kohana is not friendly and you’ll be largely resigned to reading the source code to find the available methods, properties and how they work. The new v3 release has a better set of reference documentation but it’s not like the PHP documentation, it’s just not that nice.

Kohana is designed for leet PHP programmers and will never be as popular as one of the other frameworks. You need to know this and just lower your expectations from the get-go. Kohana is what it is and if it works for you, you’ll love it. If you don’t try CodeIgniter or Cake, they’re easier to get going with and you don’t have to ask newbie questions and risk the wrath of leet coders on the Kohana forums.

PS Woody (shadowhand), if ever you want to make Kohana a popular framework, just let me know.

Categories: kohana Tags: , , , ,
  1. August 18, 2009 at 10:35 am

    Sadly this is too true. Also enjoyed your comparison post.

    One of the best communities out there is Django. There ethos and rules of engagement are really second to none. Kohana needs to have a good look at the bigger boys before they start not only alienating new developers but developers that have been there from the start. I’ve heard lead devs saying that they “don’t do documentation”, you really can’t have that.

    I use Kohana everyday and love it, though I think this is due to familiarity.

  2. Jimo
    September 16, 2010 at 10:13 am

    I love Kohana. I use it everyday, and I really didn’t find it that hard to learn. It’s true that things could be better. It’s tricky because of the different versions, but things are nicely moving the KO3 which is absolutely wonderful.

    As for the leet programmers, they really helped me so much. ShadowHand answered many of my posts, and although he is sometimes blunt, he never shies from sharing profound knowledge. Zombor’s really cool too.

  3. August 13, 2011 at 2:06 pm

    Kohana docs suck so much …. Just left it, after 3 years of working with it, because the undocumented changes make it a pile of trash.

  4. Herrn Findorf
    December 8, 2011 at 4:32 am

    I am new to Kohana but not to frameworks. Version 3.2 is the one used (I am posting this comment on Dec. 2011). My take-away is this: The framework’s biggest weakness is poorly written, incomplete, or non-functional documentation and examples. The second biggest is the bafflling, buggy and badly documented ORM module.

    The ORM is terrible. “Tightly integrated with validation” says the 3.2 docs. Ha! Trust me, save your budget and just make your models using parameterized queries (which work well) and the Validation object (not Validator object! That’s sooo 3.1), and make any of the returned data objects you need using plain old Php objects. You will be HOURS and DAYS of development time ahead if you just never even touch ORM, which is, I’ve decided, a three-letter-acronym for ‘turd’.

    But that’s not the worst part of Kohana 3.2. The documentation is horrible.

    Listen you Kohana guys, I read your comments here and there on the intertoobz about how Kohana has “pretty good” or “good documentation”. I have no idea what version you were dealing with or what you were smoking, but my opinion is if you have to read the friggin’ developers’ comments in the friggin’ source code, you do not have good documentation.

    Do people out there even understand the difference between documentation for how to use a piece of software and commenting your source code? It’s the difference between Cliff Notes and footnotes.

    If I need to go into the source code down to the method and property level to figure out what the hell to do to figure out how to make even basic functionality work, the developers of this framework have utterly and completely forgotten the entire purpose of a framework. To put it as a metaphor, the whole point of a framework is to be able to marshal the resources of a forest without having to peel the bark off every tree.

    If I have to trace every friggin’ method in every object back through multiple layers (ORM to Korana_ORM) just to find out how to use the flippin’ thing in simple CRUD operations and get error messages back, U R DOIN IT RONG! And that’s assuming the method’s actually documented. There were numerous instances where the API for ‘xyz’ said ‘Defined in ‘Kohana_xyz’ and in the documentation for Kohana_xyz was not done. As in empty. In in the API for ORM, one of the links just took me back to where I had started from, replete with a “Defined in Kohana_xyz” link that started the whole thing.

    The whole purpose of a framework is to make developers more productive MORE QUICKLY. Digging through layers of method-level comments to figure out how to make it go is a huge waste of billable hours.

    You know what I ask of a framework, of any framework? It’s simple:

    Don’t Waste Fucking My Time.

    Otherwise, why would I bother?

    • Admin
      December 8, 2011 at 7:17 pm

      I just uploaded a Kohana v3.2 last week — NHP Licensing Solutions — and enjoyed the experience, far more than my v2.3 experience.

      I agree with many of your criticisms though.

      There is a lack of good documentation but they appear to be working on it. The v3 docs are head-and-shoulders above the v2.3 but I’d still only give them a C-. There may be an official Kohana book in development which will help to fill the gap. There’s good reference material in the User Guide (built into every distribution) but there isn’t a good guide on how to get started. This is your best source of that — http://kohanaframework.org/3.2/guide/kohana — which is light.

      Kohana also relies on Stack Overflow and the Kohana Forums to handle their support. I’ve found a lot of useful examples and answers on Stack Overflow. This is the Kohana team’s preferred way of dealing with it, which I accept given the limited budget the team is working to.

      The ORM is complex for a newbie, I agree. It relies on ‘convention over configuration’ but if you don’t get the conventions you’re hooped from the beginning. Samsoir wrote an excellent guide for v2 but the best source today is — http://kohanaframework.org/3.2/guide/orm — you’ll still end up var_dump’ing your results though and sometimes you’ll just be surprised by what works.

      I also have a copy of Packt’s Beginner’s Guide to Kohana 3.0. While this isn’t perfect (things changed from v3.0 to v3.2) and many code samples have fundamental typos, it’s another valuable source of code and samples to the frustrated Kohana developer. However, it tells a story of building a real world, if not cliched, application. Rather than using disconnected examples, the book provides a thread of consistency while also teaching you how the framework functions. It’s a B- in my view.

      But even if you do get the ORM working, you don’t (and shouldn’t) use it for all of your database queries. It’s slow and always returns full rows so some of the Controllers on the site above use native queries. If ORM doesn’t make my code look logical or it adds too much processing overhead, I skip it. Most of the time I will use it though because foreach ($blogpost->tags as $tag) is a pretty neat way of accessing the tags associated with a blog post.

      From time-to-time I did have to dig into the source code though but nowhere near as much as I did for the old v2.3 site I developed. Mostly it was just to see what was happening under-the-skin as I was debugging. I also had to var_dump, echo and die just to try and work out why my code wasn’t working as expected. Most of the time it was because the examples I found didn’t match my needs and the returned objects were not what I expected.

      I still prefer Kohana though. Cake, Symfony and Zend are all better frameworks for rapid development but they struggle to scale due to the processing overhead; what you save in development time you’ll lose in processing costs and may have to re-factor your whole site down the line. It’s like developing in Visual Basic compared to Visual C# — both approaches have their merits. CodeIgniter and Kohana don’t have the overhead and are production ready but this comes at the cost of development time. It takes longer because you have to do more work.

      Kohana is more frustrating than CodeIgniter, the learning curve is much steeper but the rewards are far greater. Kohana doesn’t tell you how to develop your application and there isn’t a large community of support. It simply doesn’t suit everybody and it will never be a popular framework but for those PHP programmers who just want the basics covered and a framework to separate their models, views and controllers it fits the bill. When I developed the site above I frequently had 10 tabs open in my browser looking at the User Guide, API Browser and multiple Google searches for similar examples.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: