Django vs Zend framework: Part 1 of a thrilling framework duel

phpprogrammingpython

Written by:

Reading Time: 7 minutes

As someone who has enjoyed using different web frameworks, I cannot help but see the many similarities between all these various technologies. From how they are structured right down to their naming formats.

Today, I would like to continue my Zend framework series by contrasting it with another framework. Specifically, a comparison between Django and the Zend framework.

Would I do the classic comparison blog post, where I would write Zend does this, and Django does that? No. Instead I would put our imagination to work. Lets’ pit the frameworks against each other, in a boxing ring. These languages will face each other through six rounds. Now that sounds interesting, right? Let’s start the comparison by introducing our frameworks, and put our imagination to work.

The cast:

  • Ring announcer
  • Referee.
  • Commentator #1
  • Commentator #2
  • The Crowd
  • Zend framework
  • Django framework

Ring announcer: Good evening, and welcome to tonight’s boxing match which promises to be a classic.

Ring announcer: In the red corner, comes the contender who knows no indentation (Unlike Django, indentation is not required in Zend framework). He is a rapidly rising contender with the most used web language. He powers the ecommerce platform Magneto.

Ring announcer: And still in collaboration by many big hitters that include Adobe, IBM and Google.  The man known only as ZF to many. Here comes the Zeeeeeeeeeeend!

Ring announcer: And from the blue corner comes the world renowned framework. The unicorn who is a perfectionist for web developers with deadlines. He is from the stables of a language still ranked in the top ten of the TIOBE index. The time tested technology, the match made in heaven for startups. Here comes the Djaaaaaaaaaango!

Ring announcer: This is the first of two duels. The final prize will be framework BRAAAAAGGGGING RIGHTS!

Ring announcer: SO LET’S GET READY TO RUMBLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEEEEEE!!!

Referee: I want a good clean fight between you two. Good luck to you both. May the best language framework win?

(Bell rings)

Round 1: URL matching

Commentator #1: Django has been in this sport longer than his rival. He is used to being pitted against other frameworks like Rails. Looks like ZF is in for a long haul tonight.

Commentator #2: Yes, the Zend framework might have to take a few hits this evening. Still he can dish out a couple himself. He will have to contend against Django’s routing technique. Django uses a file called urls.py to handle requests coming to a site.

Commentator #1: That’s right. The Zend framework can counter that approach by using the modules.config file. Here each module can have its own have its own separate routes.

Commentator #2: And with that, ZF knocks down Django. I don’t believe. We were not anticipating a knock down this early. And not by the relatively younger framework.

Commentator #1: By comparison, ZF was released only three years after Django was.

Commentator #2: I thought Django had more in his tank. I guess this framework must be getting old, a we might be witnessing the rise of a new kid on the block.

Commentator #1: Sorry to interrupt you and burst your bubble. Almost as soon as Django goes to the floor, he is up again. And he looks angry that he was just floored. I guess someone forgot to tell Django this is a framework comparison war.

Commentator #2: As we were saying, both are easy to understand. Django would require more specificity in laying out the possible URLs that the user may access. Django employs having to define the regular expression for those routes.

Commentator #1: Wow regular expressions.

Commentator #2: Indeed. And regular expressions can be a big deal breaker in this fight. If I remember correctly, Zend framework also uses regular expressions.

Commentator #1: Oh hold on here people. Zend framework just used segments. With segments, ZF was able to define just one in a single route to address multiple scenarios. ZF uses literals and segments! That would give Django some serious headache to deal with.

Commentator #2: And that is absolutely great stuff for the crowd here. There is only one obvious winner here.

Judges score card: Zend framework wins

Round 2: Resources and tutorials

Commentator #2: The second round starts. And knowing ZF, he wants to prove that just like Django, he has some solid documentation footwork going on for him.

Commentator #1: Yes, and both are showing it in their punches today.

Commentator #2: The default Django blog tutorials takes you through everything you need to know. By comparison, the Zend framework, takes you through just the core. The rest, you have to figure out for yourself as you build an actual app.

Commentator #1: I totally get your point. Useful tutorials give the coder so much more comfort and ease. It assures him that if he should ever need help, there is someone out there to help him out. This is not saying that there is no one out to help those coding in the Zend framework (for instance I will be there if you ever need a helping hand).

Commentator #1: However as you can see from the crowd here, the Djangonuts are much more numerous than the Zend framework evangelists. There is so much space for improvement for the Zend framework on this point.

Commentator #1: And it looks like the Judges agree with us. This is the first round won by Django.

Judges score card: Django framework wins

Round 3: A built-in Admin panel

Commentator #1: At the start of this round, Django is showing the significance of why  having a great admin backend is great when have to interact with your models. This is good especially as a timesaving feature. And correct me if I am wrong, do all frameworks have this?

Commentator #2: A few do. Yii is one such framework I remember who does. Django is among that pack, who has this nicely wrapped up for us.

Commentator #2: This is always a big plus for anyone who starts to use the Django framework. Out of the box you have something to make viewing your models easy.  You don’t have to go look for some other package, and install it to make it so.

Commentator #1: Yes. Echoing my thoughts exactly. In Django, it is part of the package when you install the framework. To gain access to it you will have to uncomment ‘django.contrib.admin’ in your settings.py file so that it is now part of your INSTALLED_APPS configuration. And you are good to go.

(Bell rings)

Commentator #2: The icing on the cake still has to be the admin portal, with the CRUD functionality for its models.

Commentator #1:And as you can tell, boxing fans, it’s been all Django this round.

Judges score card: Django framework wins

Round 4: Database migrations

Commentator #2: ZF looks concerned.

Commentator #1: And he should be. The match is slipping from his grip.

Commentator #1: Django is really starting to assert his own dominance now. And he has been doing so for the last few rounds, and years. My money is on Django to win this contest hands down.

Commentator #2: And he looks he can do it in this round.

Commentator #1: Django might just employ that migration training in this round. If you have used migrations before, then you never want to go back to the prior way of doing things.

Commentator #2: Ok. Do mean to say, always trying to remember things like which column did you add, and on which table would now become things of the past.

Commentator #1:  Exactly. Migrations just make things saner for your development team.

Commentator #2: Is this migration training that relevant

Commentator #1: It sure is. And it is telling from Django’s performance tonight. Anyone in the audience would agree that migrations are more a part of the Django way of doing things. It’s inbuilt from the first time a beginner starts his Django journey. And that’s what you can see in the way he is strutting around on this canvas here. If you are not here to see this, then you are missing something beautiful here people. It’s like he was breed to perform on the world wide web.

Commentator #1: Oh wait people. ZF is down. Unbelievable. He is down. Can he get himself back up?

Referee: One, two, three.

Commentator #2: As you can see here people Django was working Zend framework from on all the angles.

Commentator #1: With the Zend framework, you can escape a lot of things without using doctrine migrations. Not a wise decision. There do exist methods of implementing migrations in the Zend framework, it’s just that the Django framework does them so much better.

Referee: Four, five, six.

Commentator #1: He has gotten up. He just needs to shake off the fall.

Commentator #2: Well the Ref is convinced he has, and he is good to go. I suspect that was payback for the knock down Django suffered in the first round.

Commentator #1:Still, the knock down won this round for Django.

Judges score card: Django framework wins

Round 5: Enterprise support

Commentator #2: Django has won three rounds straight. Is there anywhere into this contest for the Zend framework?

Commentator #1: One of the first promises the Zend framework makes to his fans, is to help them out when working with the big corporations likes Microsoft, IBM, Oracle and others. It has official partnerships with these companies to provide interfaces for developers to work with.

Commentator #1: One or two of those partners would be disappointed if ZF does not put his act together to reward them for the faith they have placed in him.

Commentator #2: My thoughts exactly. Such enterprise co-operation is a breath of fresh air in the framework space. It means you do not have to engineer your own hack that could easily be made deprecated once the big guns decide to its time to move on.

Commentator #1: And my oh my. With that point, Zend is looking to come back into this match. The knock down in the last round looks like a thing of the past now. With a strong performance in this round.

Judges score card: Zend framework wins

Round 6: OS support and deployment

Commentator #1: The start of the last round.

Commentator #1: The Zend framework can easily be used in on OS from which you want to work in, and deploy from. It’s true you can build a Django app in a windows environment (which is not recommended by the way), but can you setup Nginx in Windows?

Commentator #2: I am quite so sure. Maybe there is some hack-like way to achieve this. Still, from experience a Unix OS provides the smoothest experience for an Nginx web server.

Commentator #1: The Zend framework wins this round because it can work more easily and be deployed with not just Nginx (in a Unix OS), but also with Apache in a Windows.

Judges score card: Zend framework wins

 

Commentator #1: Whew! That was a long battle. That brings to an end our comparison.

Commentator #2: As we can see, the Zend framework initially gave a good account of himself in that first round. He even knocked down Django. However the close win round two seemed to make him lose his nerve, and made Django start to gain his.

Commentator #1: Django powered back like the hurricane. The Unicorn repeatedly took points off ZF in the next two rounds. Django was simply unrelenting in the punishment he was dishing out to the Zend framework.

Commentator #2: At this stage, it seemed like just a matter of time before Django would take him to the dry cleaners.  Little did the Unicorn framework, know that the ZF had other plans.

Commentator #1: A little coaching and encouragement by the ElePHPants had the Zend framework back on his feet swinging, ducking, and backing Django into his corner for the last three rounds.

Commentator #2: At the end of this match up, both warriors have given it their all. It went down to the wire. The match was too close to call for our judges. They have ended this contest as a tie. It’s all square ladies and gentlemen. There is still the second match up coming in a subsequent blog post.

Hopefully this can inform the contributors on both repos what they need to do to improve. See you all some other week. Take care and cheers champs!

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll Up